views:

205

answers:

1

I'm looking to implement a search box for a datagridview control similar to let's say firefox Control-F which would bring up a search box and on finding a match the row would be highligted etc.

Is there any similar functionality perhaps using Lucene.net or similar ?

Note - this would be different than say DataTable.Search() as the # of columns are unknown and in some cases there are dozens of columns(over 100) !

A: 

I would

  1. Search in the datasource
    (depending from the datasource you use, there could be different ways: LINQ, DataTable.Select() )
  2. Highlight or select the row in the datagridview ( myDataGridView.CurrentCell = myDataGridView.Rows[rowIndexFromSearch].Cells[0];
Peter Gfader