下面的代码工作正常并正确过滤行但是如何将表恢复到原始状态?

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

由于

有帮助吗?

解决方案

试试这个:

table.DefaultView.RowFilter = string.Empty

其他提示

这也很有魅力:

table.DefaultView.RowFilter = null /Nothing

这是最好的调整

table.DefaultView.RowFilter =" 1 = 1";

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top