There are two possible reasons for this kind of behavior:
- The columns are different in the second datatable.
The symptom of this is: you see as many empty row in the grid as there are rows in the second datatable.
Cause: Gridcontrol (gridview to be precise) already has Columns property and doesn't find matching pairs.
Solution: Call GridControl.PopulateColumns() after loading the second datatable. This will recreate Colums property.
- Gridview doesn't realize that the underlying datasource has been changed.
Symptom: you see old values.
Solution: Call GridView.Refresh()
As far as I can see from your comments, you have the former issue.
So, do something in this manner:
gridControl.DataSource = myFirstDataTable();
/* some other code*/
gridControl.DataSource = mySecondDataTable();
(gridControl.MainView as ColumnView).PopulateColumns()