Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

PivotGridControl.RestoreCollapsedStateFromStream(Stream) Method

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

Namespace: DevExpress.Xpf.PivotGrid

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

NuGet Package: DevExpress.Wpf.PivotGrid

#Declaration

public void RestoreCollapsedStateFromStream(
    Stream stream
)

#Parameters

Name Type Description
stream Stream

A Stream descendant from which the collapsed state of field values is read. If null (Nothing in Visual Basic), an exception is raised.

#Remarks

Use the RestoreCollapsedStateFromStream method to load the collapsed state of field values written to a stream via the PivotGridControl.SaveCollapsedStateToStream 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 RestoreCollapsedStateFromStream 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 (the PivotGridControl.AllowDrag and PivotGridControl.AllowHideFields properties), or save and load the field values’ collapsed states together with the control layout (the PivotGridControl.SaveLayoutToStream and PivotGridControl.RestoreLayoutFromStream methods).

Note

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

Note

The collapsed states for server mode and regular data sources are stored in different formats and not compatible with each other. Some issues can appear on restoring the collapsed state from different data source modes.

See Also