In order to bind the DataGrid to some data, you must set its DataSource
property...
DataGrid.DataSource = "someDataSource" 'Could be a DataSet, XML, a
DataTable, etc.
Then to actually put the data in the grid, you have to call its DataBind
method....
DataGrid.DataBind()
This populates the grid. If you need to put different data into the grid
than you had earlier, you can set the grid to its new data source and call
databind.
"Alan" <NO**************@yahoo.com.au> wrote in message
news:eb****************@tk2msftngp13.phx.gbl...
Sorry, can you give me the code of that please ?
"Scott M." <s-***@badspamsnet.net> wrote in message
news:%2******************@tk2msftngp13.phx.gbl... As you set the DataGrid's datasource, you'll need to call the DataGrid's
DataBind method. This will essentially reset the grid to the new data.
"Alan" <NO**************@yahoo.com.au> wrote in message
news:Ox**************@tk2msftngp13.phx.gbl... I will need to load data from a datatable to a datagrid several times. How do I clear the contents of the datagrid before loading the contents
into the datagrid ?