How can I reset table.DefaultView.RowFilter?

James May picture James May · Jun 18, 2009 · Viewed 28.3k times · Source

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

Answer

Muad'Dib picture Muad'Dib · Jun 18, 2009

try this:

table.DefaultView.RowFilter = string.Empty