windowsforms-devexpress-dot-xtrabars-dot-docking-dot-dockmanager-b905a8ac.md
Gets or sets the version of the layout of dock windows.
Namespace : DevExpress.XtraBars.Docking
Assembly : DevExpress.XtraBars.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[DefaultValue("")]
[DXCategory("Data")]
public virtual string LayoutVersion { get; set; }
<DefaultValue("")>
<DXCategory("Data")>
Public Overridable Property LayoutVersion As String
| Type | Default | Description |
|---|---|---|
| String | String.Empty |
A string representing the version of the layout of dock windows.
|
You should assign versions to layouts, if you need to customize the layout of dock panels after a previous version of the layout has been loaded from a data store (a stream, xml file or system registry) and applied to the control.
Consider this example. An earlier version of an application contained one dock panel (Panel1). When running the application an end-user saved the layout of the dock windows to an XML file. Then a new version of the application was designed. For example, it added another panel (Panel2). By default, when the previously saved layout is loaded within the new application the current layout of the dock windows will be overridden. Only Panel1 will be visible. Panel2 will be hidden.
To enable end-users to work with previously saved layouts, and ensure that new features and dock panels will still be visible after old layouts have been loaded, you should do the following:
Suppose an earlier version of an application contained one dock panel (dockPanel1). When running the application, an end-user saved the layout of the dock windows to an XML file. Then, a new version of the application was designed. For example, it added another panel (dockPanel2). By default, when the previously saved layout is loaded within the new application, the current layout of the dock windows will be overridden. Only dockPanel1 will be visible. dockPanel2 will be hidden.
To enable end-users to work with previously saved layouts, and ensure that new features and dock panels will still be visible after old layouts have been loaded, you should specify the layout versions via the DockManager.LayoutVersion property, and handle the DockManager.LayoutUpgrade event:
In this example, the new dockPanel2 panel is registered within the dock manager and then docked to the bottom of the window.
private void dockManager1_LayoutUpgrade(object sender,
DevExpress.Utils.LayoutUpgradeEventArgs e) {
dockPanel2.Register(dockManager1);
dockPanel2.DockTo(DevExpress.XtraBars.Docking.DockingStyle.Bottom);
}
Private Sub dockManager1_LayoutUpgrade(ByVal sender As Object, _
ByVal e As DevExpress.Utils.LayoutUpgradeEventArgs) Handles dockManager1.LayoutUpgrade
dockPanel2.Register(dockManager1)
dockPanel2.DockTo(DevExpress.XtraBars.Docking.DockingStyle.Bottom)
End Sub
See Also