Skip to main content

How to: Save a View's Layout to and Restore it from the Registry

Tip

You can utilize the Persistence Behavior or Workspace Manager component to save and restore layouts for all supported DevExpress controls at once.

The following example saves the layout of the GridControl.MainView to the system registry and then restores it. The full path for the layout in the registry will be: HKEY_CURRENT_USER\DevExpress\XtraGrid\Layouts\MainLayout

    string regKey = "DevExpress\\XtraGrid\\Layouts\\MainLayout";
    gridControl1.MainView.SaveLayoutToRegistry(regKey);

    //...

    gridControl1.MainView.RestoreLayoutFromRegistry(regKey);