2009-06-17 6 views
12

Le code ci-dessous fonctionne correctement et filtre correctement les lignes, mais comment restaurer la table dans son état d'origine?Comment réinitialiser table.DefaultView.RowFilter?

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

Merci

Répondre

26

essayez ceci:

table.DefaultView.RowFilter = string.Empty 
+0

a très bien, merci. –

+0

Génial! grand merci: D – Tony

-3

c'est le meilleur tweak

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

+1

Non, ce n'est pas, définitivement pas – Treycos

0

Cela fonctionne aussi comme un charme:

table.DefaultView.RowFilter = null /Nothing 
Questions connexes