VGridControlBase.RestoreLayoutFromRegistry(String) Method
SECURITY NOTE
Deserializing layout settings from untrusted resources may create security issues. Review the following help topic for additional information: Safe Deserialization.
Restores the layout stored at the specified system registry path.
Namespace: DevExpress.XtraVerticalGrid
Assembly: DevExpress.XtraVerticalGrid.v24.1.dll
NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid
Declaration
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.
string registryPath =
"HKEY_LOCAL_MACHINE\\SOFTWARE\\DevExpress Inc\\XtraVerticalGrid";
vGridControl1.SaveLayoutToRegistry(registryPath);
vGridControl2.DataSource = vGridControl1.DataSource;
vGridControl2.RestoreLayoutFromRegistry(registryPath);