Back to Devexpress

VGridControlBase.RestoreLayoutFromRegistry(String) Method

windowsforms-devexpress-dot-xtraverticalgrid-dot-vgridcontrolbase-dot-restorelayoutfromregistry-x28-system-dot-string-x29.md

latest3.8 KB
Original Source

VGridControlBase.RestoreLayoutFromRegistry(String) Method

SECURITY-RELATED CONSIDERATIONS

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

Declaration

csharp
public virtual void RestoreLayoutFromRegistry(
    string path
)
vb
Public Overridable Sub RestoreLayoutFromRegistry(
    path As String
)

Parameters

NameTypeDescription
pathString

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.

csharp
string registryPath = 
"HKEY_LOCAL_MACHINE\\SOFTWARE\\DevExpress Inc\\XtraVerticalGrid";
vGridControl1.SaveLayoutToRegistry(registryPath);
vGridControl2.DataSource = vGridControl1.DataSource;
vGridControl2.RestoreLayoutFromRegistry(registryPath);
vb
Dim registryPath As String = _
"HKEY_LOCAL_MACHINE\SOFTWARE\DevExpress Inc\XtraVerticalGrid\"
VGridControl1.SaveLayoutToRegistry(registryPath)
VGridControl2.DataSource = VGridControl1.DataSource
VGridControl2.RestoreLayoutFromRegistry(registryPath)

See Also

RestoreLayoutFromStream

RestoreLayoutFromXml

Save and Restore Layouts of DevExpress controls

VGridControlBase Class

VGridControlBase Members

DevExpress.XtraVerticalGrid Namespace