Skip to main content

VGridControlBase.SaveLayoutToRegistry(String) Method

Saves a vertical grid’s layout to a system registry path.

Namespace: DevExpress.XtraVerticalGrid

Assembly: DevExpress.XtraVerticalGrid.v22.2.dll

NuGet Package: DevExpress.Win.VerticalGrid


public virtual void SaveLayoutToRegistry(
    string path


Name Type Description
path String

A string value which specifies the system registry path to which the layout is saved.


Use the SaveLayoutToRegistry method to save the grid’s layout to the system registry. You can restore these settings using the VGridControlBase.RestoreLayoutFromRegistry method.

You can define whole and partial registry keys as the parameter. For instance, specifying “Software\MyCompany\MyProject" as a partial key will result in settings being saved to the “HKEY_CURRENT_USER\Software\MyCompany\MyProject" path. You can also specify the entire path if you need to store the layout at another root key. An example is the “HKEY_LOCAL_MACHINE\Software\MyCompany\MyProject" registry path.


The following sample code saves a vertical grid’s layout to the registry and then applies it to a different vertical grid. The VGridControlBase.SaveLayoutToRegistry and VGridControlBase.RestoreLayoutFromRegistry methods are used for this purpose.

The image below shows the result.

SaveLayoutToXml - method

string registryPath = 
"HKEY_LOCAL_MACHINE\\SOFTWARE\\DevExpress Inc\\XtraVerticalGrid";
vGridControl2.DataSource = vGridControl1.DataSource;
See Also