Back to Devexpress

PivotGridControl.RestoreLayoutFromXml(String, OptionsLayoutBase) Method

windowsforms-devexpress-dot-xtrapivotgrid-dot-pivotgridcontrol-dot-restorelayoutfromxml-x28-system-dot-string-devexpress-dot-utils-dot-optionslayoutbase-x29.md

latest4.5 KB
Original Source

PivotGridControl.RestoreLayoutFromXml(String, OptionsLayoutBase) Method

SECURITY-RELATED CONSIDERATIONS

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 using the specified settings from the specified XML file.

Namespace : DevExpress.XtraPivotGrid

Assembly : DevExpress.XtraPivotGrid.v25.2.dll

NuGet Package : DevExpress.Win.PivotGrid

Declaration

csharp
public void RestoreLayoutFromXml(
    string xmlFile,
    OptionsLayoutBase options
)
vb
Public Sub RestoreLayoutFromXml(
    xmlFile As String,
    options As OptionsLayoutBase
)

Parameters

NameTypeDescription
xmlFileString

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

| | options | OptionsLayoutBase |

A OptionsLayoutBase descendant that specifies which options should be restored.

|

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 options parameter determines which options should be restored from the file. For the Pivot Grid Control you can create a OptionsLayoutGrid object, customize it as required and then pass it as the options parameter. Only the options that are enabled in this object will be restored.

To restore all the options you can pass null or the static OptionsLayoutBase.FullLayout property as the options parameter.

The RestoreLayoutFromXml overload without the options parameter restores only the options which are specified by the Pivot Grid Control’s PivotGridControl.OptionsLayout property.

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.

See Also

SaveLayoutToXml

RestoreLayoutFromRegistry

RestoreLayoutFromStream

SaveCollapsedStateToFile(String)

SaveCollapsedStateToStream(Stream)

LoadCollapsedStateFromFile(String)

LoadCollapsedStateFromStream(Stream)

LayoutUpgrade

OptionsLayout

Save and Restore Layouts of DevExpress controls

PivotGridControl Class

PivotGridControl Members

DevExpress.XtraPivotGrid Namespace