How can I reset table.DefaultView.RowFilter?
-
06-07-2019 - |
Question
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
Solution
try this:
table.DefaultView.RowFilter = string.Empty
OTHER TIPS
This works also like a charm:
table.DefaultView.RowFilter = null /Nothing
this is the best tweak
table.DefaultView.RowFilter = "1=1";
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow