If you set the AutoFitStyle
to ExtendLastColumn
the Width
property on the last column doesn't reflect the actual width of the column. If you you set the AutoFitStyle
to None
you could set and read the column Width.
However, at least just for reading, there is a workaround:
In your example above, with only one column, you can get the CellSizeResolved property of the column
UltraGridColumn column = grid.DisplayLayout.Bands[0].Columns[0];
Debug.WriteLine("Column width is " + column.CellSizeResolved.Width);