The following sample code demonstrates how to save and load a grid view’s layout at runtime.
string fileName = "gridlayout.xml";
gridView1.SaveLayoutToXml(fileName);
// ...
gridView1.RestoreLayoutFromXml(fileName);
Dim fileName As String = "gridlayout.xml"
gridView1.SaveLayoutToXml(fileName)
' ...
GridView1.RestoreLayoutFromXml(fileName)