LayoutControl.SaveLayoutToXml(String) Method

Saves the layout to an XML file.

Namespace: DevExpress.XtraLayout

Assembly: DevExpress.XtraLayout.v20.1.dll

Declaration

public virtual void SaveLayoutToXml(
    string xmlFile
)
Public Overridable Sub SaveLayoutToXml(
    xmlFile As String
)

Parameters

Name Type Description
xmlFile String

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

Remarks

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

See Save and Restore Layout to learn more.

TIP

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

Examples

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.
layoutControl1.SaveLayoutToXml(f);
// ...
// Restore a previously saved layout.
layoutControl1.RestoreLayoutFromXml(f);

Implements

DevExpress.XtraLayout.ILayoutControl.SaveLayoutToXml(String)
DevExpress.Utils.Serializing.ISupportXtraSerializer.SaveLayoutToXml(String)
See Also