PivotGridControl.RestoreLayoutFromStream(Stream) Method

Restores a Pivot Grid Control's layout from the specified stream.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v20.1.dll

Declaration

public void RestoreLayoutFromStream(
    Stream stream
)
Public Sub RestoreLayoutFromStream(
    stream As Stream
)

Parameters

Name Type Description
stream Stream

A Stream descendant from which the Pivot Grid Control's settings are read. If null (Nothing in Visual Basic), an exception is raised.

Remarks

Use the RestoreLayoutFromStream method to load the Pivot Grid Control's layout from the stream to which the layout was saved via the PivotGridControl.SaveLayoutToStream method.

The PivotGridControl.OptionsLayout property controls which settings should be restored from the stream.

NOTE

When restoring a layout during a form load (for instance, in your Form.Load event handler), you may need to call the PivotGridControl.ForceInitialize method prior to the layout restoration. See this method to learn more.

Examples

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);

Implements

DevExpress.Utils.Serializing.ISupportXtraSerializer.RestoreLayoutFromStream(Stream)
See Also