1、Save Layout to a Stream
System.IO.Stream str;
//...
// creating and saving the view's layout to a new memory stream
str = new System.IO.MemoryStream();
gridControl1.FocusedView.SaveLayoutToStream(str);
str.Seek(0, System.IO.SeekOrigin.Begin);
// ...
// loading the view's layout from a previously saved memory stream
gridControl1.FocusedView.RestoreLayoutFromStream(str);
str.Seek(0, System.IO.SeekOrigin.Begin);
2、Save Layout to the System Registry
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);
3、Save Layout to XML File
string fileName = "c:\\XtraGrid_SaveLayoutToXML.xml";
gridView1.SaveLayoutToXml(fileName);
// ...
gridView1.RestoreLayoutFromXml(fileName);