VGridControlBase.SaveLayoutToStream(Stream) Method

Saves a vertical grid's layout to the specified stream.

Namespace: DevExpress.XtraVerticalGrid

Assembly: DevExpress.XtraVerticalGrid.v20.1.dll

Declaration

public virtual void SaveLayoutToStream(
    Stream stream
)
Public Overridable Sub SaveLayoutToStream(
    stream As Stream
)

Parameters

Name Type Description
stream Stream

A Stream descendant to which a vertical grid's layout is written.

Remarks

Use the SaveLayoutToStream method to write a vertical grid's layout to a stream. The layout can then be read using the VGridControlBase.RestoreLayoutFromStream method.

Examples

The following sample code saves the vertical grid's layout to a file stream and then applies it to another vertical grid. The VGridControlBase.SaveLayoutToStream and VGridControlBase.RestoreLayoutFromStream methods are used for this purpose.

using System.IO;

string fileName = "C:\\XtraVerticalGridLayout";
FileStream outFile = new FileStream(fileName, FileMode.Create);
vGridControl1.SaveLayoutToStream(outFile);
outFile.Close();
vGridControl2.DataSource = vGridControl1.DataSource;
FileStream inFile = new FileStream(fileName, FileMode.Open);
vGridControl2.RestoreLayoutFromStream(inFile);
inFile.Close();

Implements

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