Pregunta

El siguiente código funciona bien y filtra las filas correctamente, pero ¿cómo restablecería la tabla a su estado original?

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

Gracias

¿Fue útil?

Solución

prueba esto:

table.DefaultView.RowFilter = string.Empty

Otros consejos

Esto también funciona como un encanto:

table.DefaultView.RowFilter = null /Nothing

este es el mejor ajuste

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top