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
2945
How can I reset the layout?
posted

If I attempt to restore the layout of a dock manager, and that fails, the layout is left in a corrupt state (e.g. dock panes that can't be sized and on top of each other).

There are certain situations where I guess this can't be avoided, for example, an updated version of an application is obfuscated and all the control names change.

Anyway, my question is, how can I restore the layout back to what it was before LoadFromBinary was called?  I can trap the load when it fails, but I need to be able to reset (uncorrupt) the layout. 

Thanks,
Campbell 

Parents
No Data
Reply
  • 53790
    posted

    Hello Campbell,

    jcwild said:
    If I attempt to restore the layout of a dock manager, and that fails, the layout is left in a corrupt state (e.g. dock panes that can't be sized and on top of each other).

    .  Maybe one possible solution could be if you are using two types of layout. Let`s say "System layout" and "User Layout". The first one will be like a default layout (if the users didn`t specify thier own layout) and will be created from developers. This layout will be readOnly for the users.  The second one - "User Layout" could be modify from each user. So when the user`s layout is left in a corrupt state, you could load the "System Layout".

    Please note that developers should take care for a "System layout", so when you make version update or changes in the control`s name, you should be sure that the layout is not corrupt.

    jcwild said:
    Anyway, my question is, how can I restore the layout back to what it was before LoadFromBinary was called? I can trap the load when it fails, but I need to be able to reset (uncorrupt) the layout.

    Maybe you could try to hide all visible panes using ultraDockManager1.HideAll(); method, disable all save/load settings/layouts and try to initialize your form again.

    Let me know if you have any questions.

    Regards

Children
No Data