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
250
saveasxml extensibility
posted

I have a grid which we will add new columns to over time.  I would like to use saveasxml and loadfromxml to preserve some basic user grid settings, such as the state of filters, column widths and positions and which columns are sorted and or hidden.

However, I have found that if I modify the datasource and add a new column, then when I loadfromlayout, certain settings of the new column; such as the position and column title get screwed up.

Is there any way around this, or any recommended practices for using saveasxml and anticipating future extensions to a grid.  Or am I better off just preserving settings myself in some other mechanism.

Thanks

Parents
  • 469350
    Verified Answer
    Offline posted

    What exactly happens to the new column?

    My guess is that since the new column does not exist in the layout, the grid just ignores it and the VisiblePositions of the other columns and up getting set but the VisiblePosition on the new column is not set, so it's essentially arbitrary.

    What you might want to do is load the layout into an UltraGridLayout variable, rather than directly into the grid. Then you could examine the loaded layout and look at it's columns and see if there are any columns in the data source that do not exist in the layout. Then you could try to modify the layout or the properties of the column to try to get it to show up in the position you want, either before of after loading the layout into the grid.

Reply Children
No Data