windowsforms-devexpress-dot-xtraverticalgrid-dot-vgridcontrolbase-dot-restorelayoutfromregistry-x28-system-dot-string-x29.md
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.v25.2.dll
NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid
public virtual void RestoreLayoutFromRegistry(
string path
)
Public Overridable Sub RestoreLayoutFromRegistry(
path As String
)
| 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.
|
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".
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);
Dim registryPath As String = _
"HKEY_LOCAL_MACHINE\SOFTWARE\DevExpress Inc\XtraVerticalGrid\"
VGridControl1.SaveLayoutToRegistry(registryPath)
VGridControl2.DataSource = VGridControl1.DataSource
VGridControl2.RestoreLayoutFromRegistry(registryPath)
See Also