Skip to main content

LayoutControl.RestoreLayoutFromXml(String) Method

SECURITY NOTE

Deserializing layout settings from untrusted resources may create security issues. Review the following help topic for additional information: Safe Deserialization.

Restores the layout from the specified XML file.

Namespace: DevExpress.XtraLayout

Assembly: DevExpress.XtraLayout.v24.2.dll

Declaration

public virtual void RestoreLayoutFromXml(
    string xmlFile
)

Parameters

Name Type Description
xmlFile String

A String value which specifies the path to the XML file that contains the layout to be loaded. If the specified file doesn’t exist, an exception is raised.

Remarks

The RestoreLayoutFromXml method loads a layout that has been saved to a file in XML format using the LayoutControl.SaveLayoutToXml method.

See Save and Restore Layout to learn more.

Example

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);

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the RestoreLayoutFromXml(String) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also