I have removed a column from my datasource. But the users have the column saved in their previous old layout preferences files which they saved earlier. As suggested in other posts I have loaded a new UltraGridLayout object with that file. I now want to remove the specific column from that layout by doing
layout.Bands[0].Columns.Remove(column);
But it is returning an error for can't change/remove bound column. The layout object is still not bound or loaded to any grid. How can I remove that specific column from the layout so that when I load it to the grid then it does not return a error?
Hi,
I think you probably have to load the layout into the grid first and then remove the column. At that point, the grid will know that there is no datasource column mapped to the column and it will treat it like an unbound column. I think that will work, although I haven't tried it out. If it doesn't work, please let me know and we will look into it further.
Also I noticed that the grid does not throw any exception for the old xml. Does the grid handle this by itself the different column names or can it throw some exception in some other case.
Hi Mike,
The grid does not add a new column (bounded/unbounded) in columns collection when we load a xml which contains extra column which is not in datasource.
Also I am facing another problem when I apply the layout. The datafilters on the column editors do not work and the grid starts displaying the original data as soon as I apply the layout from the xml.