Skip to main content
A newer version of this page is available. .

PivotGridControl.SaveLayoutToStream(Stream) Method

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

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v21.2.dll

NuGet Packages: DevExpress.Win.Design, DevExpress.Win.PivotGrid

Declaration

public void SaveLayoutToStream(
    Stream stream
)

Parameters

Name Type Description
stream Stream

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

Remarks

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.

Note

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

Tip

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

Example

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();
pivotGridControl1.SaveLayoutToStream(stream);
stream.Seek(0, System.IO.SeekOrigin.Begin);

// ...
pivotGridControl1.RestoreLayoutFromStream(stream);
stream.Seek(0, System.IO.SeekOrigin.Begin);
See Also