Pergunta

O código abaixo funciona bem e filtra as linhas corretamente, mas como eu ia restaurar a tabela ao seu estado original?

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

Graças

Foi útil?

Solução

tente o seguinte:

table.DefaultView.RowFilter = string.Empty

Outras dicas

Isso funciona também como um encanto:

table.DefaultView.RowFilter = null /Nothing

este é o melhor ajuste

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top