Back to Devexpress

PivotGridControl.RestoreLayoutFromRegistry(String) Method

windowsforms-devexpress-dot-xtrapivotgrid-dot-pivotgridcontrol-dot-restorelayoutfromregistry-x28-system-dot-string-x29.md

latest4.5 KB
Original Source

PivotGridControl.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.XtraPivotGrid

Assembly : DevExpress.XtraPivotGrid.v25.2.dll

NuGet Package : DevExpress.Win.PivotGrid

Declaration

csharp
public void RestoreLayoutFromRegistry(
    string path
)
vb
Public 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 Pivot Grid Control which has been written to the system registry using the PivotGridControl.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 PivotGridControl.OptionsLayout property provides options that define which settings should be restored from the registry.

Note

When restoring a layout during a form load (for instance, in your Form.Load event handler), you may need to call the PivotGridControl.ForceInitialize method prior to the layout restoration. See this method to learn more.

Example

The following sample code can be used to write and read a Pivot Grid Control’s layout to/from the system registry. The full path for the Pivot Grid Control’s layout will be: HKEY_CURRENT_USER\DevExpress\XtraPivotGrid\Layouts\MainLayout.

csharp
string regKey = "DevExpress\\XtraPivotGrid\\Layouts\\PivotGridLayout";
pivotGridControl1.SaveLayoutToRegistry(regKey);

// ...

pivotGridControl1.RestoreLayoutFromRegistry(regKey);
vb
Dim regKey As String = "DevExpress\\XtraPivotGrid\\Layouts\\PivotGridLayout"
PivotGridControl1.SaveLayoutToRegistry(regKey)

' ...

PivotGridControl1.RestoreLayoutFromRegistry(regKey)

See Also

SaveLayoutToRegistry

RestoreLayoutFromStream

RestoreLayoutFromXml

SaveCollapsedStateToFile(String)

SaveCollapsedStateToStream(Stream)

LoadCollapsedStateFromFile(String)

LoadCollapsedStateFromStream(Stream)

OptionsLayout

Save and Restore Layouts of DevExpress controls

PivotGridControl Class

PivotGridControl Members

DevExpress.XtraPivotGrid Namespace