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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

datagrid, searching for records

Status
Not open for further replies.

honeypot

Technical User
Mar 6, 2001
147
GB
Hi all :)
i have a windows form with a datagrid on it. I also have a textbox txtSearch where users will type in a name and then the datagrid displays the records based on the search.
While i know what i want to do...i have no idea how to achieve this?? any help would be much appreciated. Eg..what would the code behind the txtSearch be?
 
Quick and untested, but one way is to use a DataView
Code:
Dim dv As New DataView
dv = dt.DefaultView
dv.RowFilter = "name like 'SMITH*'"

Then set the grids datasource to the dataview


Sweep
...if it works dont mess with it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top