Skip to main content

BaseView.SaveLayoutToRegistry(String, OptionsLayoutBase) Method

Saves the View’s layout using the specified settings to the specified system registry path.

Namespace: DevExpress.XtraGrid.Views.Base

Assembly: DevExpress.XtraGrid.v24.2.dll

Declaration

public void SaveLayoutToRegistry(
    string path,
    OptionsLayoutBase options
)

Parameters

Name Type Description
path String

A string value specifying the system registry path to which the layout is saved.

options OptionsLayoutBase

A OptionsLayoutBase descendant specifying which options should be saved.

Remarks

Use the SaveLayoutToRegistry method to save specific settings of a View to the system registry. The settings can then be restored via the BaseView.RestoreLayoutFromRegistry method.

The options parameter determines which options should be saved to the registry. For the grid control you can create a OptionsLayoutGrid object, customize it as required and then pass it as the options parameter. Only the options that are enabled in this object will be saved

Specific options which are disabled in the options parameter are not affected.

To save all the options pass null or a static OptionsLayoutBase.FullLayout property as the options parameter.

The SaveLayoutToRegistry overload without the options parameter saves only the options which are determined by the ColumnView.OptionsLayout property.

For the path parameter you can define whole and partial registry keys. For example, if you define “Software\Company", the full path will be as follows: “HKEY_CURRENT_USER\Software\Company". To store a layout in a different root key define the entire path in the following form “HKEY_LOCAL_MACHINE\Software\Company".

Important

The Document Manager identifies its child documents by names of controls hosted within these documents. Thus, it is recommended that you set unique names for these controls. Failure to comply with this recommendation will result in an exception for certain scenarios (e.g., saving and restoring a View layout by using 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.

See Also