I have a "empty" grid on a form.
Behind a button "Load", I query data from a MS SQL server in a datatable and then assign the datatable to the grid and do some formatting to the columns (set width, titles, datetime formats and so on.
This works fine, as long as I only query the same data (datatable / datafields)
But as soon as I change the datasource (same datatable name but more fields, the Grid / Gridview don't refreshes (don't show the additional rows)!
If I query the datatable with the additional fields first, the grid shows the additional fields correct.
The problem is, that the grid don't refresh the layout, if it was showed with the "small" datatable first and the the datasource is changed to the "big" datatable (with more fields).
Exactly what another user has noted here a long time ago (was marked as bug):
https://www.devexpress.com/Support/Center/Question/Details/B190858
I have tried:
GridErgebnisanzeige.DataSource = Nothing
GridErgebnisanzeige.DataSource = Ergebnis
GridView1.LayoutChanged()
GridView1.RefreshEditor(True)
GridErgebnisanzeige.PerformLayout()
GridErgebnisanzeige.RefreshDataSource()
GridView1.RefreshData()
Nothing works… :-(
How to refresh the Grid/Gridview (data and layout) after change the datasource (same datable name but more fields / columns)?
Thanks