How can I set the width of a column after my grid has already been loaded? (seems like such a simple task but I can't seem to get it...)Example: Program is running, user performs some action, I want to resize one or more columns.
Thank you,Mike
I would also like to know how to do this in code.
In my case, if the user has adjusted the column widths, I want to save the widths when the form is closing and set them the next time they open the form.
I have tryed setting the CellWidth and ColumnWidth but they don't seem to make any difference.
ron.
What it the ETA for the next release with this fix?
Hi,
Has this been resolved? I am using v8.1and cannot make it work.
I have 2 grids and when a user resizes a column width on one grid, I want to set the column width on the other grid to match. I have a routine that should work, but nothing gets changed. I have something like this that I fire after a CellWidthResolved property has changed. Unfortunately, it has to set every field every time a column width is adjusted, but it does not happen that often and at least they should stay in synch this way.
Rather than using an event I have synchronised the widths of the columns of a Master and Details grid by binding the Details grid Field Width to the CellResolvedWidth of the corresponding Master Field:
foreach(var field in _myDataGrid.FieldLayouts[1].Fields){ var b = new Binding("CellWidthResolved"); b.Source = _myDataGrid.FieldLayouts[0].Fields[fieldName]; BindingOperations.SetBinding(field, Field.WidthProperty, b);
}
This seems to work nicely.