Skip to main content

LayoutControl.LayoutVersion Property

Gets or sets the version of the layout.

Namespace: DevExpress.XtraLayout

Assembly: DevExpress.XtraLayout.v22.2.dll

NuGet Package: DevExpress.Win.Navigation


public virtual string LayoutVersion { get; set; }

Property Value

Type Default Description
String String.Empty

A string representing the version of the layout.


If you need to customize the control after an earlier version of the control’s layout has been loaded and applied to the control, assign layout versions.

For example, let us assume an earlier version of an application was released and contained a LayoutControl with two layout items (ID and Name). When running the application, an end-user saved the control’s layout to an XML file. Then, a new version of the application was designed,adding a new layout item (Gender). By default, when the previously saved layout is loaded within the new application, the current control’s layout will be overridden, and the Gender layout item will be hidden.

To solve the problem, customizing the control’s layout after the old layout has been loaded, you should do the following:

  • Design a new version of the control’s layout, setting the version via the LayoutVersion property. Ensure that the version of the current control’s layout differs from saved layouts.
  • Handle the control’s LayoutControl.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 current control’s layout.

    For the example above, handle the LayoutUpgrade event to make a new layout item visible.

See Also