Skip to main content

NavBarControl.LayoutVersion Property

Gets or sets the version of the control’s layout.

Namespace: DevExpress.XtraNavBar

Assembly: DevExpress.XtraNavBar.v23.2.dll

NuGet Packages: DevExpress.Win, DevExpress.Win.Navigation

Declaration

[DefaultValue("")]
public virtual string LayoutVersion { get; set; }

Property Value

Type Default Description
String String.Empty

A string representing the version of the control’s layout.

Remarks

You should assign versions to layouts if you need to customize the control after an earlier version of the control’s layout has been loaded and applied to the control.

Consider an example. Suppose an earlier version of an application contained a NavBarControl with a single group (Group1). When running the application an end-user saved the NavBarControl’s layout to an XML file. Then a new version of the application was designed. For instance, it added another group (Group2). By default, when the previously saved layout is loaded within the new application the current layout of the control will be overridden. Therefore only Group1 will be visible. The second group will be hidden.

To allow end-users to work with previously saved layouts and ensure that new features aren’t lost and new groups and items will still be visible after old layouts have been loaded you should do the following:

  • When designing a new version of the control’s layout set the version via the LayoutVersion property. At the least, you need to ensure that the version of the current control’s layout differs from that of the saved layouts.
  • Handle the BarManager.LayoutUpgrade event to implement a routine that will upgrade old layouts. This event occurs after a previously saved layout has been loaded and only if its version doesn’t match the version of the current control’s layout.

    For the above example you could handle the LayoutUpgrade event to display the hidden group (Group2) in a specific position.

See Also