Hi,
Is there any way to change the field position by code in the field layout?.
The ActualPosition property is read only and changing the Column property has not effect... I guess that the ActualPosition property as priority over the Column property.
Anyone?
Thanks.
The version currently I am using is 11.1
Hello Ankit,
Could you please tell us what is the version of NetAdvnatage that you use, so we could be able to reproduce your behavior?
Looking forward for your reply.
Hi All,
I have some problems while using SaveCustomization & LoadCustomization for XamdataGrid
Scenario:
-1. Dynamically adding Fields to the Grid on ViewerLoad event. Lets say the order is: Col1,Col2,Col3,Col4
-2. User add/removes Fields and do some ordering: Col3,Col2,Col1
-3. Saves the Layout of the Grid, using MemoryStream and SaveCustomization
-4. While loading it back the order which we get is: Col1,Col2,Col3 (see the order of the fields added initially)
Now when I checked the XML file, the order is as point no. 2. I wonder what is the issue here.
Hello,
Thank you for your post. I can say that the Fields collection order is not taken in to account for the fields order, that’s why you see this approach is not working. So you have to use ActualPosition property of the FieldClass more information you can find here:
http://help.infragistics.com/NetAdvantage/WPF/2011.2/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v11.2~Infragistics.Windows.DataPresenter.Field~ActualPosition.html
and after calling it you should call EnsureUniqueFieldPositions in order to reposition the fields with the new position:
http://help.infragistics.com/NetAdvantage/WPF/2011.2/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v11.2~Infragistics.Windows.DataPresenter.FieldLayout~EnsureUniqueFieldPositions.html
What you need to do is for example :
this.dataGrid.FieldLayouts[0].Fields[0].ActualPosition = new FieldPosition(1, 0, 0, 1);
this.dataGrid.FieldLayouts[0].EnsureUniqueFieldPositions();
Hope this helps you.
Has anybody found a solution to this?