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

PivotGridControl.RestoreLayoutFromXml(String) Method

Restores a Pivot Grid Control’s layout from the specified XML file.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v18.2.dll

Declaration

public void RestoreLayoutFromXml(
    string xmlFile
)

Parameters

Name Type Description
xmlFile String

A string value specifying the path to the XML file from which Pivot Grid Control’s settings are read. If the specified file doesn’t exist, an exception is raised.

Remarks

Use the RestoreLayoutFromXml method to load the Pivot Grid Control’s layout which was written to a file in the XML format using the PivotGridControl.SaveLayoutToXml method.

The PivotGridControl.OptionsLayout property controls which settings should be restored from the file.

Note

When restoring a layout during a form load (for instance, in your Form.Load event handler), you may need to call the PivotGridControl.ForceInitialize method prior to the layout restoration. See this method to learn more.

Example

The code below demonstrates how the Pivot Grid Control’s layout can be saved to and then restored from an XML file.

string fileName = "c:\\XtraPivotGrid_Layout.xml";
// Saves layout to an XML file.
pivotGridControl1.SaveLayoutToXml(fileName);

// ...
// Restores the previously saved layout.
pivotGridControl1.RestoreLayoutFromXml(fileName);

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