How can I find a Data in a DatagridView without a database

-2

Hello very good to all my question is how I can search a datagridview data using a textbox, what I mean is typing and if it matches what you type in the texbox it appears in the datagridview without a database.

    
asked by Emmanuel Aguilar 06.03.2018 в 07:07
source

1 answer

1

Using RowFilter , you should add the event

 TextChanged

To the textbox with which you want to filter and inside, you are setting what is the condition, for example

 (dataGridViewFields.DataSource as DataTable).DefaultView.RowFilter = string.Format("Nombre = '{0}'", textBoxBusqueda.Text);

In this case when you write the '' Name '' in the textbox, the DataGridView will only show the row corresponding to that name.

Greetings.

    
answered by 06.03.2018 в 12:22