Skip to main content
A newer version of this page is available. .

TreeList.SaveLayoutToXml(String) Method

Saves a control’s layout to a specified XML file.

Namespace: DevExpress.XtraTreeList

Assembly: DevExpress.XtraTreeList.v19.2.dll

Declaration

public virtual void SaveLayoutToXml(
    string xmlFile
)

Parameters

Name Type Description
xmlFile String

A string value specifying the XML file name.

Remarks

Use the SaveLayoutToXML method to save the TreeList control’s layout to an XML file. You can restore saved settings later, via a TreeList.RestoreLayoutFromXml method call.

The Tree List options that are saved are identified by the TreeList.OptionsLayout object.

Tip

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

Example

The following sample code saves the layout of the Tree List control to an XML file and then restores it. The TreeList.SaveLayoutToXml and TreeList.RestoreLayoutFromXml methods are used for this purpose.

string fileName = "c:\\TreeListLayout.xml";
treeList1.SaveLayoutToXml(fileName);
treeList2.DataSource = treeList1.DataSource;
treeList2.RestoreLayoutFromXml(fileName);

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SaveLayoutToXml(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