Clearing A Datagrid

  • Thread starter Thread starter Ed Bick
  • Start date Start date
E

Ed Bick

I am binding a datagrid to SQL Adapter.

I am wanting to clear it out and populate with a different data set based on
user action. I can not seem to find the equivalent to a VB6 Clear method.

Can anyone please help me with this, I'm sure very simple task.

Thanks
 
Ed,
You do not clear the DataGrid itself per se, you clear & repopulate the
underlying DataTable, or you replace the DataTable with a new DataTable.

Hope this helps
Jay
 
Like Jay mentions, call DataTable.Clear which will clear the underlying
table and then you can repopulate it. However, if you may need the data
again, then just rebind it.
 
Hello

First clear the datatable and then :

DataGrid1.DataSource = Nothing

Kind Regards
Jorge
 
Back
Top