Skip to main content

PivotGridControl.SaveLayoutToStream(Stream, OptionsLayoutBase) Method

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

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v24.1.dll

NuGet Package: DevExpress.Win.PivotGrid

Declaration

public void SaveLayoutToStream(
    Stream stream,
    OptionsLayoutBase options
)

Parameters

Name Type Description
stream Stream

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

options OptionsLayoutBase

A OptionsLayoutBase descendant that specifies which options should be saved.

Remarks

Use this SaveLayoutToStream method overload to save specific settings of a Pivot Grid Control to a stream. The settings can then be restored via the PivotGridControl.RestoreLayoutFromStream method.

The options parameter determines which options should be saved to the stream. For the Pivot Grid Control you can create a OptionsLayoutGrid object, customize it as required and then pass it as the options parameter. Only the options that are enabled in this object will be saved.

To save all the options you can pass null or the static OptionsLayoutBase.FullLayout property as the options parameter.

The SaveLayoutToStream overload without the options parameter saves only the options which are specified by the PivotGridControl.OptionsLayout property.

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.

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

Note

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