Skip to main content

PivotGridControl.SaveLayoutToXml(String) Method

Saves the PivotGridControl's layout to a file in XML format.

Namespace: DevExpress.Xpf.PivotGrid

Assembly: DevExpress.Xpf.PivotGrid.v14.2.dll

#Declaration

public void SaveLayoutToXml(
    string fileName
)

#Parameters

Name Type Description
fileName String

A String value that specifies the target file name.

#Remarks

To restore the pivot grid layout previously saved by the SaveLayoutToXml method, use the PivotGridControl.RestoreLayoutFromXml or PivotGridControl.RestoreLayoutFromXmlAsync method.

Note that the SaveLayoutToXml, PivotGridControl.RestoreLayoutFromXml and PivotGridControl.RestoreLayoutFromXmlAsync methods directly access the file system, which is forbidden by the default Silverlight security sandbox. To use these methods, you should configure your application to require elevated trust. To learn how to do this, see the Trusted Applications MSDN topic.

To correctly save and restore the layout, you should specify unique names for all pivot grid fields. You can do this using the PivotGridField.Name property.

You can also save and restore the pivot grid layout from a stream using the PivotGridControl.SaveLayoutToStream and PivotGridControl.RestoreLayoutFromStream methods respectively.

To learn more about layout serialization, see Save and Restore Layout.

See Also