Board index » Visual Studio » Find function in datagrid

Find function in datagrid

Visual Studio208
Is it possible to implement Find functionality in a Web Forms

datagrid? If so, is there sample code I can look at?



thanks

tg


-
 

Re:Find function in datagrid

Well, bear in mind that once the page is rendered you no longer have a grid

or a dataset, but rather static html in a browser. If you can be more

specific about what you want to do when you find a particular row in the

grid, I can be more specific with recommendations. However, at a high

level, you'll most likely have to take one of the following two approaches:



1. Use DHTML on the client-side to modify the page after finding a

particular string in the table tags generated by the server-side datagrid

control; or



2. Write server-side code to reopen a dataset, find the row based on user

input, and then set the grid's SelectedItem or SelectedIndex property

accordingly. In this scenario, the database is requeried and the page

regenerated.



Hope this helps!



Steven Bras, MCSD

Microsoft Developer Support/Data Access Technologies



This posting is provided "AS IS" with no warranties, and confers no rights.



Microsoft Security Announcement: Have you installed the patch for Microsoft

Security Bulletin MS03-026?  If not Microsoft strongly advises you to

review the information at the following link regarding Microsoft Security

Bulletin MS03-026

www.microsoft.com/security/security_bulletins/ms03-026.asp">www.microsoft.com/security/security_bulletins/ms03-026.asp and/or to

visit Windows Update at windowsupdate.microsoft.com">windowsupdate.microsoft.com to install the

patch. Running the SCAN program from the Windows Update site will help to

insure you are current with all security patches, not just MS03-026.







-