How can I reset table.DefaultView.RowFilter?
Asked Answered
G

2

21

The code below works fine and filters the rows correctly but how would I restore the table to its original state?

DataTable table = this.dataGridView1.DataSource as DataTable;
table.DefaultView.RowFilter = comboBox.Text + " LIKE '%" + strName + "%'";

Thanks

Galimatias answered 17/6, 2009 at 22:59 Comment(0)
L
39

try this:

table.DefaultView.RowFilter = string.Empty
Loveinamist answered 17/6, 2009 at 23:2 Comment(0)
O
3

This works also like a charm:

table.DefaultView.RowFilter = null /Nothing
Obnubilate answered 14/10, 2016 at 7:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.