Category / Section
When I reassign a new DataTable to the grid's DataSource, it doesn't repaint the new DataTable. What am I missing?
1 min read
Before assigning the new datatable, reset the DataSource, Datamember and the volatile data of the grid. After assigning the new DataTable try calling the grid.Refresh().
C#
this.gridDataBoundGrid1.DataSource = null;
this.gridDataBoundGrid1.DataMember = null;
this.gridDataBoundGrid1.Model.ResetVolatileData();
this.gridDataBoundGrid1.DataSource = newDataTable;
this.gridDataBoundGrid1.Refresh();
VB
Me.gridDataBoundGrid1.DataSource = null
Me.gridDataBoundGrid1.DataMember = null
Me.gridDataBoundGrid1.Model.ResetVolatileData()
Me.gridDataBoundGrid1.DataSource = newDataTable
Me.gridDataBoundGrid1.Refresh()
Sample:
http://websamples.syncfusion.com/samples/kb/grid.windows/GDBGRebind/main.htm