Skip to main content

PivotGridControl.RestoreLayoutFromXml(String) Method


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

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

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v24.1.dll

NuGet Package: DevExpress.Win.PivotGrid


public void RestoreLayoutFromXml(
    string xmlFile


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.


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.


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.


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.

// ...
// Restores the previously saved layout.
See Also