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...
How to access DataRecordCellArea.ActualWidth?
Two questions related to custom column sizing:
1. Is there any event to subsribe when Vertical ScrollBar appears or dissapears on the grid? - I need to evaluate the width of vertical scrollbar for my custom sizing.
2. When resizing host window how do you achieve the grid resizing is only done when dragging is stoped?
I tried to subscribe to XamDataGrid.SizeChanged event, but it fires to often and has a huge impact on performance.
Thanks
Any comments on the issue? thanks
HI,
As far as scrollbars appearing ,
there is no event. the grid contains a recordlistcontrol. that recordlistcontrol has a scrollviewer in its template. its really up to that element to decide when scrollbars show. it does this based on its ScrollbarVisibility properties. for the root recordlistcontrol those properties are based on the (Horizontal|Vertical)ScrollbarVisibility properties of the View. in the case of the GridView, those default to Auto. the ScrollViewer does 1 or more measures of its content during the measure pass updating its Computed(H|V)ScrollBarVisibility properties. those properties are used by the scrollbar's in the scrollviewer's template to determine their visibility. that's just how scrollviewers work. there is no simple event or anything since typically you don't care.
Sincerely, Matt
Matt,
Thanks for follow.
Here is what we have: to implement what we're looking for you suggested an approach which - as it stands - unfortunately would not work, as features would be missing to properly implement that approach.
What other suggestions would you have to resolve the issue?
We're still stuck here. Infragistics support... anybody there?
We're still stuck on that issue. What steps would you suggest to resolve it?