Reputation: 147
dv.RowFilter = String.Format("NAME like '%{0}%'", txtsearch.Text)
gridunpaid.DataSource = dv
i used this code above to filter and it is working fine.
here is what i want. only in the Data Grid View item will filter not on database is this possible?
Upvotes: 0
Views: 100
Reputation: 11115
You can filter DataGridView
without changing DataSource
using this code:
Ctype(gridunpaid.DataSource, DataTable).DefaultView.RowFilter = String.Format("NAME like '%{0}%'", txtsearch.Text)
Upvotes: 1