Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to save and restore the DockLayoutManager layout

$
0
0

DockLayoutManager provides several methods to save and restore layout settings:
- SaveLayoutToStream;
- SaveLayoutToXml;
- RestoreLayoutFromStream;
- RestoreLayoutFromXml.

Note that item names are used to identify them when saving/restoring a layout, so it will be necessary to set names for all DXDocking items to make sure that settings will be restored properly.

It may happen that some panels were added/removed after the DockLayoutManager's layout was saved. In this scenario, DockLayoutManager will remove panels that are not present in the saved layout and ignore saved settings for items that do not exist anymore. To change this behavior, set the following options:
- To re-create panels that are present in the saved layout, set RestoreLayoutOptions.RemoveOldPanels to False.
- Set RestoreLayoutOptions.AddNewPanels to True to maintain panels that are not present in the saved layout.

Please note that the DockLayoutManager's methods save settings only of its groups and panels. To save settings of embedded controls, use WorkspaceManager as shown at How to save and restore settings of all controls that are present in the UI.

See also:
How to serialize a particular panel layout
How to serialize custom panels and their properties
How to save and restore settings of all controls that are present in the UI


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>