Back to Devexpress

TreeList.SaveLayoutToRegistry(String, OptionsLayoutBase) Method

windowsforms-devexpress-dot-xtratreelist-dot-treelist-dot-savelayouttoregistry-x28-system-dot-string-devexpress-dot-utils-dot-optionslayoutbase-x29.md

latest3.2 KB
Original Source

TreeList.SaveLayoutToRegistry(String, OptionsLayoutBase) Method

SECURITY-RELATED CONSIDERATIONS

Using file paths sourced from untrusted input may expose unauthorized files or allow unintended file access. Always validate and normalize all external paths to prevent path manipulation.

Saves the control’s layout to the specified system registry path, using the specified options.

Namespace : DevExpress.XtraTreeList

Assembly : DevExpress.XtraTreeList.v25.2.dll

NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList

Declaration

csharp
public virtual void SaveLayoutToRegistry(
    string path,
    OptionsLayoutBase options
)
vb
Public Overridable Sub SaveLayoutToRegistry(
    path As String,
    options As OptionsLayoutBase
)

Parameters

NameTypeDescription
pathString

A string value specifying the system registry path.

| | options | OptionsLayoutBase |

An OptionsLayoutTreeList object that specifies which Tree List options must be saved. Or, a OptionsLayoutBase.FullLayout object, to save all the settings.

|

Remarks

Use the SaveLayoutToRegistry method to save the TreeList’s layout to the system registry. You can restore these settings via a TreeList.RestoreLayoutFromRegistry method call.

The control’s layout is saved to the path specified by the path parameter. You are allowed to define whole and partial registry keys. For instance, if you define a partial key, “Software\MyCompany\MyTool" the full path will be as follows: “HKEY_CURRENT_USER\Software\MyCompany\MyTool". If you wish to store a layout in a different root key, you should define the entire path, for instance: “HKEY_LOCAL_MACHINE\Software\MyCompany\MyTool".

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

Save and Restore Layouts of DevExpress controls

TreeList Class

TreeList Members

DevExpress.XtraTreeList Namespace