Comment puis-je réinitialiser table.DefaultView.RowFilter?
-
06-07-2019 - |
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
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