windowsforms-devexpress-dot-utils-dot-baseappearancecollection-dot-savelayouttoregistry-x28-system-dot-string-x29.md
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 appearance settings to a system registry path.
Namespace : DevExpress.Utils
Assembly : DevExpress.Utils.v25.2.dll
NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core
public virtual void SaveLayoutToRegistry(
string path
)
Public Overridable Sub SaveLayoutToRegistry(
path As String
)
| Name | Type | Description |
|---|---|---|
| path | String |
A string value specifying the system registry path to which the appearance settings are saved.
|
Use the SaveLayoutToRegistry method to save the activated appearance settings to the system registry. The appearance settings are activated if their corresponding options are enabled. You can then restore these settings using the BaseAppearanceCollection.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 saving settings to the “HKEY_CURRENT_USER\Software\MyCompany\MyProject" path. You can also specify the entire path if you need to store the appearance settings to another root key, for instance “HKEY_LOCAL_MACHINE\Software\MyCompany\MyProject".
The following code can be used to write and read the appearance settings applied to the XtraGrid’s elements to/from the system registry. The full path used is: HKEY_CURRENT_USER\DevExpress\Utils\Layouts\Appearance.
string regKey = "DevExpress\\Utils\\Layouts\\Appearance";
gridControl1.MainView.Appearance.SaveLayoutToRegistry(regKey);
//...
gridControl1.MainView.Appearance.RestoreLayoutFromRegistry(regKey);
Dim regKey As String = "DevExpress\Utils\Layouts\Appearance"
gridControl1.MainView.Appearance.SaveLayoutToRegistry(regKey)
'...
gridControl1.MainView.Appearance.RestoreLayoutFromRegistry(regKey)
See Also
RestoreLayoutFromRegistry(String)
Save and Restore Layouts of DevExpress controls
BaseAppearanceCollection Class