[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand].NET Core 3 Support
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Collapse]Layout Management
   [Collapse]Dock Windows
    [Expand]Getting Started
    [Expand]Dock Items
    [Expand]Layout Items
    [Expand]Runtime Features
    [Collapse]Miscellaneous
      Saving and Restoring the Layout of Dock Panels and Controls
      Managing Dock Panels in Code
      MVVM Support - Building Dock UI
      Move Panels Between DockLayoutManager Instances
      WPF and WinForms Interoperation Limitations
    [Expand]Examples
   [Expand]Tile and Layout
   [Expand]Tab Control
   [Expand]Carousel
    Book Control
    Workspace Manager
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Saving and Restoring the Layout of Dock Panels and Controls

The layout of dock panels and the layout of controls within panels/groups can be saved to a data store (an XML file or stream), and then restored from this data store, overriding the changes made since the layout was saved. This document provides more information on this topic.

Expanded Saving and Restoring the Layout of Dock Panels and Controls

The layout of dock panels, layout items and controls can be saved to a data store manually using one of the following methods: DockLayoutManager.SaveLayoutToStream and DockLayoutManager.SaveLayoutToXml. To restore a layout, use one of the corresponding methods: DockLayoutManager.RestoreLayoutFromStream or DockLayoutManager.RestoreLayoutFromXml.

The history of dock operations is not saved when layouts are saved to a data store.

To correctly save and restore the layout of controls, ensure that all Dock Items and Layout Items have the Name properties specified or the BaseLayoutItem.BindableName property bound.

Expanded Layout Settings

By default, dock panels that are present within a saved layout, but not present in the DockLayoutManager, are not created when calling the RestoreLayoutFrom... methods. To recreate these panels, set the RestoreLayoutOptions.RemoveOldPanels attached property for a DockLayoutManager to False

Panels that are present in the DockLayoutManager, but absent in the saved layout, are moved to the to the ClosedPanels (see DockLayoutManager.ClosedPanels) collection during the restore layout operation. You can traverse through these panels and restore them manually (see: Managing Dock Panels in Code). To force the DockLayoutManager to completely remove such panels, disable the attached RestoreLayoutOptions.AddNewPanels property in your DockLayoutManager:

Is this topic helpful?​​​​​​​