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
1170
Gracefully add new columns to an application with saved customizations
posted

I've got an application where users can customize their xamdatagrid field layout and the changes are saved at the end of each session. When a request comes in to add an additional column to the application, I want the new column to be appended to the end of the grid. But when the column ordering has been changed it seems like the new column will be assigned a somewhat random position.

I've tried to resolve this by handling the FieldLayoutInitialized event and iterating over the fields, tracking any fields  that weren't in the last saved layout, then going over that subset of fields to move them to the edge of the grid. It doesn't seem to work, either usingthe Fields.Move(...) method or setting a new ActualPosition with my desired column number.

Is there an officially sanctioned way to integrate a new column into a saved layout without upsetting the position of the existing columns?