Skip to main content

LayoutControl.SaveLayoutToXml(String) Method

Saves the layout to an XML file.

Namespace: DevExpress.XtraLayout

Assembly: DevExpress.XtraLayout.v22.2.dll

NuGet Package: DevExpress.Win.Navigation


public virtual void SaveLayoutToXml(
    string xmlFile


Name Type Description
xmlFile String

A String value that specifies the path to the file where the layout should be stored. If an empty string is specified, an exception is raised.


Use the SaveLayoutToXml method to save the current layout to a file in XML format at runtime. The saved settings can then be restored using the LayoutControl.RestoreLayoutFromXml method.

See Save and Restore Layout to learn more.


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


The code below demonstrates how the layout can be saved to and then restored from an XML file.

string f = "c:\\Layout.xml";
// Save the layout to an XML file.
// ...
// Restore a previously saved layout.
See Also