Delete all of the contents in a datagrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to delete all of the contents in a datagrid before re-loading it. Please help

Thanks.
 
Hi Bil

What you meant by deleting all the content in the datagrid, is it clearing the datagrid or deleting the records from the database itself

Sadha Sivam
Malleable Minds Software Pvt Ltd
 
Hi Bill,

I assume this is a windowforms question.
A little bit in other words than Sadha said, clear the datasource (mostly
the table)

Cor
 
Cor Ligthert said:
Hi Bill,

I assume this is a windowforms question.
A little bit in other words than Sadha said, clear the datasource (mostly
the table)

Cor


Presume the datagrid is bound to the table (test_table in e.g)

test_table.clear()

should clear the table and empty the datagrid

Regards

Adam
 
If you just want to clear the grid without deleting any data, you can set the datasource to nothing and then restore it
grdMyGrid.Datasource = Nothin
grdMyGrid.Refres
grdMyGrid.Datasource = ? (name of your datasource


----- Bill wrote: ----

I need to delete all of the contents in a datagrid before re-loading it. Please help

Thanks.
 
Back
Top