Question

Le code ci-dessous fonctionne correctement et filtre les lignes correctement, mais comment pourrais-je restaurer la table à son état d'origine?

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

Merci

Était-ce utile?

La solution

essayez ceci:

table.DefaultView.RowFilter = string.Empty

Autres conseils

Cela fonctionne aussi comme un charme:

table.DefaultView.RowFilter = null /Nothing

c'est le meilleur tweak

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top