Highlight the data in the DataGrid when it is searched...

Please support our C# advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Reply

Join Date: Jul 2007
Posts: 292
Reputation: jireh is an unknown quantity at this point 
Solved Threads: 37
jireh's Avatar
jireh jireh is offline Offline
Posting Whiz in Training

Highlight the data in the DataGrid when it is searched...

 
0
  #1
Dec 26th, 2007
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!
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 85
Reputation: williamrojas78 is an unknown quantity at this point 
Solved Threads: 4
williamrojas78's Avatar
williamrojas78 williamrojas78 is offline Offline
Junior Poster in Training

Re: Highlight the data in the DataGrid when it is searched...

 
0
  #2
Dec 28th, 2007
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C# Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC