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
315
WinGrid 9.1 - DisplayLayout.SaveToXML
posted

Hi There,

We would like to leverage Ultragridlayout.SaveToXML/LoadFromXML to preserve user defined column widths, positions and sorting. If I use PropertyCategories.All for SaveToXML , any subsequent changes to the grid like adding/removing columns are not shown and throws an error randomly.  

1) Ideally I would like to preserve ONLY columns widths, positions and sorting. Should I be using some other value or combinations of values for PropertyCategories???

AppearanceCollection Serialize Appearance Collection
Bands Serialize Bands
Groups Serialize Groups
UnboundColumns Serialize UnBound Columns
SortedColumns Serialize Sorted Columns
ColScrollRegions Serialize Column Scroll Regions
RowScrollRegions SerializeRow Scroll Regions
General Serializes properties exposed off the layout as well as sub objects that are not explicitly listed in this enum.
ValueLists Serialize Value Lists
Summaries Serialize summaries. This will also serialize bands as well.
ColumnFilters Serialize ColumnFilers off the band. This will also serialize bands as well. NOTE: This does not serialize column filters off the RowsCollection.
All Serialize All

2) Is there a builtin method to reset the grid settings to its defaults? 

Thanks,

Ramesh

 

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    Hi Ramesh,

    rtumati said:
    1) Ideally I would like to preserve ONLY columns widths, positions and sorting. Should I be using some other value or combinations of values for PropertyCategories???

    I don't think there are any options that will allow you to save the position and width of columns and not save the hidden state.

    What I would do is load the layout, then hide the columns in code after tha layout has already been loaded.

    rtumati said:
    2) Is there a builtin method to reset the grid settings to its defaults? 

    grid.DisplayLayout.Reset will reset the grid to the defaults. But these might not be the same defaults you see when you put a new grid on a form, because the grid designer also loads a default preset into the grid. This is optional, and you could turn it off or change the preset, but you probably haven't done so. So you might want to load the same preset into the grid to return it to the default state you had at design-time.

    To load a preset into the grid, you would use the PresetSerializer class which has static methods to load presets.

Children