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
1180
Layout serialization - howto set "defaults" ?
posted

I'm trying to serialize grid layout. My intention is to keep user column filters, sorting, grouping (outlook groupby) and column widths for windows of same type (MDI).

What I try to do is: ultraGrid.DisplayLayout.Save(memStream,  PropertyCategories.ColumnFilters | PropertyCategories.SortedColumns | PropertyCategories.Groups) and it works almost fine.

Many of my grid properties are initialized at runtime - groups (row layouts), column header text, grouping, etc. I noticed that in some cases I loose column headers text and couple of other things set dynamically during form loads (probably because I deserialize layout of empty window into window that already has some data)

I found Mike's post that says : "... the saved layout only includes things that have actually changed - but by that I mean things that have changed from the default values in the grid - not neccessarily things that the user changed...", so I understand, that things done during window initalization (at runtime, not design time) will be serialized and deserialized as if user did this?

Is there a way I could tell to grid that "keep changes as default, and from now on track changes to be serialized" to distinguish user layout operations from "legal" ones?

 

 

 

 

Parents
  • 469350
    Offline posted

    Hi,

    I'm not sure I understand what you are asking.

    Perhaps what you need to do is save the layout of your grid at a point before the user makes any changes. That way you have a baseline that you would load into the grid that would re-set the user back to the defaults.

    Of course, the layout you saved might not include everything. So what you would do is call grid.DisplayLayout.Reset first, then load your layout. That way everything is reset to the default values and you load your defaults into a clean layout.

Reply Children