Searching Data

mks

New member
Joined
Oct 31, 2005
Messages
2
Programming Experience
1-3
Hi
Im having a problem of displaying records in a datagrid, which should be filtered when a user types on a textbox.
Eg. there is a customer form. when the form loads it displays all customer details on th datagrid(works fine). there is a search facility where you can search for a customer by his name. when the user type a charactor on text box the grid should get populated with customers who's first char. of the name if equals to typed char. without retrieving from database..
 
You would need to set the DefaultView.RowFilter property of the DataTable that is acting as the DataSource, e.g.
VB.NET:
myDataTable.DefaultView.RowFilter = "Name LIKE '" & myTextBox.Text & "%'"
 
jmcilhinney said:
You would need to set the DefaultView.RowFilter property of the DataTable that is acting as the DataSource, e.g.
VB.NET:
myDataTable.DefaultView.RowFilter = "Name LIKE '" & myTextBox.Text & "%'"

thank for the reply. but this does not solve the problem. In Rowfilter it shows only the filtered records(removing others).. what i want is to when I type a Charactor, to Point to the coresponding records. In Find method U could do it.. but it doesnt take Like Keyword when Filtering..
 
Back
Top