The same question as here:
question
But in my case my dataGridView1.DataSource is null.
I use the dataGridView1.Rows.Add function to add rows to the table.
Is it possible to add the filter the column of dataGridView using textbox without DataSource?
It may be possible filter a datagrid that doesn’t have a datasource, but I suspect it isn’t.
Regardless, an easier solution would be to just give the grid a datasource. Rather than programmatically adding rows to the datagrid, instead create a
DataTableand add rows to it, then set the grid’s data source to that table. Now you can use standard filtering methods.