PivotGridControl.SaveLayoutToRegistry(String) Method
Saves a Pivot Grid Control’s layout to a 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 to which the layout is saved. |
Remarks
If a Pivot Grid Control’s layout has been saved to the system registry using the SaveLayoutToRegistry method it can then be restored using the PivotGridControl.RestoreLayoutFromRegistry method.
You can define whole and partial registry keys as the parameter. For instance, specifying “Software\MyCompany\MyProject" as a partial key will result in settings being saved to the “HKEY_CURRENT_USER\Software\MyCompany\MyProject" path. You can also specify the entire path if you need to store the layout at another root key. An example is the “HKEY_LOCAL_MACHINE\Software\MyCompany\MyProject" registry path.
The PivotGridControl.OptionsLayout property provides options that define which settings should be saved to the registry.
Note
The expansion states of field values are not saved by the SaveLayoutToRegistry method.
Tip
You can utilize the Persistence Behavior or Workspace Manager component to save and restore layouts for all supported DevExpress controls at once.
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);