A simple question

  • Thread starter Thread starter Humber Consumer
  • Start date Start date
H

Humber Consumer

Please pardon my ignorance,
I want to know how to clear data from a datagrid. I attached a dataset
to a datagrid. Now I want to clear the current data from datagrid and
want to attach new dataset with the datagrid.
I don't know how to clear the current dataset out of datagrid
Looking forward for some help
 
So you have already assigned one DataTable to a DataGrid, correct? Now you
want to change the data displayed in the DataGrid with data from another
DataTable? Just re-assign the new DataTable (I assume that you have
DataTable's in your DataSet) to the DataGrid like this:

this.dataGrid1.DataSource = this.dsTemp.Tables["MyTable"];

The DataGrid will rebind and update to reflect the new data in this table.
If this is not what you want, can you describe your problem in more detail.
 
Back
Top