My UltraWinGrid (V 9.1) behaves weird: the first screen shot show that the grid has 5 columns
however the following code:
grid.DisplayLayout.BandsSerializer[0].Columns.Contains("Gas") failed!
as screen shot 2 why?
This code fails because you are passing in a string. The Columns collection does not contain any strings, it contains a UltraGridColumn objects.
You should be using the Exists method to see if a column exists with the specified key.
Resolved with following code; but I still don't know why the previous one failed:
foreach(var col in grid.DisplayLayout.BandsSerializer[0].Columns){ if( col.Key.Equals("Gas")) col.Width = iPresetValue;
}
I've read Mike's post, he suggested not to use BandsSerializer. But my case is to resume stored Grid display information (column width etc)