Skip to main content

PivotGridControl.RestoreCollapsedStateFromFile(String) Method

Restores the collapsed state of field values from the specified file.

Namespace: DevExpress.Xpf.PivotGrid

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

#Declaration

public void RestoreCollapsedStateFromFile(
    string path
)

#Parameters

Name Type Description
path String

A String value which specifies the path to the file from which the collapsed state of field values is read. If the specified file doesn't exist, an exception is raised.

#Remarks

Use the RestoreCollapsedStateFromFile method to load the collapsed state of field values which was written to a stream via the PivotGridControl.SaveCollapsedStateToFile method.

The collapsed states of field values can only be restored in the same layout they were saved in. If the control layout was changed after saving the collapsed states (for instance, some fields have been reordered or hidden), the RestoreCollapsedStateFromFile method may have no effect, or may restore the collapsed states incorrectly. To ensure that the collapsed states are loaded correctly, prevent end-users from changing the control layout (use the PivotGridControl.AllowDrag and PivotGridControl.AllowHideFields properties), or save and load the field values' collapsed states together with the control layout (use the PivotGridControl.SaveLayoutToXml and PivotGridControl.RestoreLayoutFromXml methods).

NOTE

The RestoreCollapsedStateFromFile method has no effect if used when data is not loaded (i.e. the PivotGridControl.DataSource property is not initialized).

See Also