Denver
Denver

Reputation: 147

Filtering only on DataGridView items

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

Answers (1)

tezzo
tezzo

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

Related Questions