Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
745
Programatically change the column position.
posted

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.

Parents
  • 2426
    Suggested Answer
    posted

    Hello sebl,

    The FieldCollection object inherits an ObservableCollection<Field>. You can utilize the ObservableCollection's Move() method to accomplish what you are looking for. For example:

    grid.FieldLayouts[0].Fields.Move(1, 0);

    The two integer parameters are the oldIndex and newIndex, respectively.

    For more information, you can see the documentation here.

Reply Children