Then you need to rebuild the grid. I would suggest you call the function data, get the data set, and then apply the row filter:
var view=GetDataSet().Tables[0].DefaultView
view.RowFilter = "CustomerName = 'My Customer'";
dataGridViewMain.DataSource=view;
dataGridViewMain.DataBind();
Otherwise, you may have to do this:
var view=(dataGridViewMain.DataSource as DataSet).Tables[0].DefaultView
view.RowFilter = "CustomerName = 'My Customer'";
dataGridViewMain.DataSource=view;
dataGridViewMain.DataBind();
source
share