corelibraries-devexpress-dot-utils-dot-optionslayoutbase-f0edb6cd.md
Gets or sets the version of the layout.
Namespace : DevExpress.Utils
Assembly : DevExpress.Data.v25.2.dll
NuGet Package : DevExpress.Data
[DefaultValue("")]
public string LayoutVersion { get; set; }
<DefaultValue("")>
Public Property LayoutVersion As String
| Type | Default | Description |
|---|---|---|
| String | String.Empty |
A string representing the version of the layout.
|
You can access this nested property as listed below:
| Library | Object Type | Path to LayoutVersion |
|---|---|---|
| Cross-Platform Class Library | OptionsLayoutBase |
.FullLayout .LayoutVersion
| | PropertyAllowEventArgs |
.OptionsLayout .LayoutVersion
| | WinForms Controls | BaseView |
.OptionsLayout .LayoutVersion
| | SchedulerControl |
.OptionsLayout .LayoutVersion
|
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.
Suppose an earlier version of an application was released and this contained a control (for instance, the XtraGrid) which had two columns (ID and Name). When running the application an end-user saved the layout of the control to an XML file. Then a new version of the application was designed. For instance, it added a new column (Gender) and grouping by this column. By default, when the previously saved layout is loaded within the new application the current layout of the control will be overridden. The Gender column will not be destroyed by default (this depends upon the control’s OptionsColumnLayout.AddNewColumns setting). It will appear in a specific position in the control but data will not be grouped by this column.
To solve the problem, i.e. to customize the control’s layout after an old layout has been loaded you should do the following:
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the LayoutVersion property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
pivot-grid-for-winforms-layout-upgrade/CS/WinPivotUpgradeLayout/Form1.cs#L21
pivotGridControlNew.OptionsLayout.AddNewGroups = true;
pivotGridControlOld.OptionsLayout.LayoutVersion = "1.0";
pivotGridControlNew.OptionsLayout.LayoutVersion = "2.0";
pivot-grid-for-winforms-layout-upgrade/VB/WinPivotUpgradeLayout/Form1.vb#L24
pivotGridControlNew.OptionsLayout.AddNewGroups = True
pivotGridControlOld.OptionsLayout.LayoutVersion = "1.0"
pivotGridControlNew.OptionsLayout.LayoutVersion = "2.0"
See Also