Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wild Search in DataGrid /DefaultView

Status
Not open for further replies.

cariaco99

Programmer
Jan 31, 2004
17
0
0
US
HI there.
I have a DataGrid bound to a SQL table in a VB.NET Windows Application.

How can I perform a search on all fields of the DataGrid/DefaultView?

When I review the Find Method, it enforces to Grid to be sorted by a field, but I want to search a string in ALL fields.

For instance, if I type 'Smith' and click my 'Search' button, I want to find (and scroll to) a record with LastName='Smith', but then I might find the Next Record containing Company='Smith & Wesson' and the next one containg CompanyType='Locksmith', etc.
Ideally, I would like to

1) Change the BackColor of the cells (Row,Col) in the Rows where the Search Text was found.
2) Scroll the DataGrid to the first found record.
3) When I press 'F3' or click 'Next' go to the next found record.
4) etc.

I believe this must be something fairly common. Any code out there?
Any ideas?
thanks
cariaco99
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top