I am attempting to restore the column sizes for a DataView. I save the column sizes on the Close event, and I try to restore the column sizes after I setup the columns. I have tried both the Column(x).ActualWidth and Column.ScaledWidth properties, but the grid always shows as the default width. I do have it set to allow user resize. What do I need to do?
Column(x).ActualWidth and Column(x).ScaledWidth are both intended to be used for calculating the location of the column boundaries at runtime.
You can restore either Column(x).WidthExpression or aDataView.ColumnWidths
ColumnWidths will return a concatenated string of all Column WidthExpressions and can be set again if the same columns and order will be restored. Otherwise, use the individual WidthExpression values.
The values can be different from what was set in the initial values if the user has resized or moved the columns.
Using the Column(x).WidthExpression works as I expected.
Thank you.