Skip to main content
A newer version of this page is available. .

VGridControlBase.RestoreLayoutFromRegistry(String) Method

Restores the layout stored at the specified system registry path.

Namespace: DevExpress.XtraVerticalGrid

Assembly: DevExpress.XtraVerticalGrid.v19.1.dll

Declaration

public virtual void RestoreLayoutFromRegistry(
    string path
)

Parameters

Name Type Description
path String

A string value which specifies the system registry path. If the specified path doesn’t exist, this method does nothing.

Remarks

The RestoreLayoutFromRegistry method restores the layout of a vertical grid which has been written to the system registry using the VGridControlBase.SaveLayoutToRegistry method. You can define whole and partial registry keys as this method’s parameter. For example, if you define “Software\Company", the full path will be as follows: “HKEY_CURRENT_USER\Software\Company". If you wish to store the layout in another root key, you should define the entire path in the form “HKEY_LOCAL_MACHINE\Software\Company".

Example

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";
vGridControl1.SaveLayoutToRegistry(registryPath);
vGridControl2.DataSource = vGridControl1.DataSource;
vGridControl2.RestoreLayoutFromRegistry(registryPath);
See Also