Skip to main content

PivotGridControl.SaveLayoutToStream(Stream) Method

Saves a Pivot Grid Control’s layout to the specified stream.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v24.1.dll

NuGet Package: DevExpress.Win.PivotGrid


public void SaveLayoutToStream(
    Stream stream


Name Type Description
stream Stream

A Stream descendant to which a Pivot Grid Control’s layout is written.


Use the SaveLayoutToStream method to write a Pivot Grid Control’s layout to a stream. The layout can then be read using the PivotGridControl.RestoreLayoutFromStream method.

The PivotGridControl.OptionsLayout property controls which settings should be saved to the stream.


The expansion states of field values are not saved by the SaveLayoutToStream method.


You can utilize the Persistence Behavior or Workspace Manager component to save and restore layouts for all supported DevExpress controls at once.


The following sample code saves a Pivot Grid Control’s layout to a memory stream and then restores it.

System.IO.Stream stream;
stream = new System.IO.MemoryStream();
stream.Seek(0, System.IO.SeekOrigin.Begin);

// ...
stream.Seek(0, System.IO.SeekOrigin.Begin);

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SaveLayoutToStream(Stream) method.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also