Not sure this will completely solve ur problem.
Generally a dataset is used to populate the datagridview, datagrid etc
the instead of clearing the datagridview u need to clear the dataset that populates it.
If Dataset ds = new Dataset();
dgv1.Datasource = ds.Tables["aaa"];
If u want to clean the grid use
ds.Clear();
dgv1.Refresh();
I hope this will help.
|