Hi,
Is there any way to achieve such behavior on XamDataGrid(vol 10.3):
If user resizes the colum, all columns widths to the left are staying as before resizing and columns to the right are resized.
If user resizes the window which hosts the grid - all columns are resized proportionally.
Thanks.
HI Dierk,
You could wire up the XamDataGrid's FieldLayout's PropertyChanged event. In this event you could
modify other fields widths.
Here is some sample code:
xamgrid1.FieldLayoutInitializing += new EventHandler<Infragistics.Windows.DataPresenter.Events.FieldLayoutInitializingEventArgs>(xamgrid1_FieldLayoutInitializing); void MainWindow_PropertyChanged(object sender, PropertyChangedEventArgs e) { //throw new NotImplementedException(); // MessageBox.Show(e.PropertyName); if (e.PropertyName == "CellWidthResolved") { foreach (Field f in xamgrid1.FieldLayouts[0].Fields) { if (f.Name != "Kids") { xamgrid1.FieldLayouts[1].Fields[f.Name].Settings.LabelWidth = f.LabelWidthResolved; xamgrid1.FieldLayouts[1].Fields[f.Name].Settings.CellWidth = f.CellWidthResolved; } } // xamgrid1.FieldLayouts[0].Fields[0].Width } }
Sincerely, MattDeveloper Support Engineer
How do I know which field was resized? After I resize one column sometimes every single field rises event and simetimes only field which was resized...