PivotGridControl.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.XtraPivotGrid
Assembly: DevExpress.XtraPivotGrid.v24.1.dll
NuGet Package: DevExpress.Win.PivotGrid
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 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.
string regKey = "DevExpress\\XtraPivotGrid\\Layouts\\PivotGridLayout";
pivotGridControl1.SaveLayoutToRegistry(regKey);
// ...
pivotGridControl1.RestoreLayoutFromRegistry(regKey);