Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to: Save a control's layout to the system registry

The following sample code demonstrates a way of saving a view’s layout (in XtraGrid) to a specific system registry path and then restoring it.

You can define absolute and relative registry keys as the parameter. For example, specifying “Software\MyCompany\MyProject" as a partial key will result in saving the settings to the “HKEY_CURRENT_USER\Software\MyCompany\MyProject" path. You can also specify the entire key if you need to store the layout to another root key.

string regKey = "DevExpress\\XtraGrid\\Layouts\\MainLayout";
advBandedGridView1.SaveLayoutToRegistry(regKey);
// ...
advBandedGridView1.RestoreLayoutFromRegistry(regKey);