Articles in this section
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

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied