the problem is this: Example I have five data in the datagrid(of course the data comes from the database.) and I want row of the datagrid to be highligted when the the data was found after searching it...
If I have five rows and the data was found in the 3rd row, the 3rd row must be highlighted...remember all five rows must always visible when it was search, therefor in searching the data you must not use the keyword LIKE.

Hope you get my point...

thanks!

Hi

I am not sure if i understand completely but here: if you are trying to find an specific record on a data table the easiest way (for me) is to filter the table or dataview with the specified criteria. If you want the datagrid to show the rows (records) all the time then create a copy of the datatable or the dataview the datagrid is using as datasource or just freeze the screen while filtering; after that, just look for the record number and select the correct row in the datagrid.

The other option is to loop thru the rows in the datagrid itself and compare the data in the row with the desired data and when found then select the row.

hope it helps.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.