Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

VGridControlBase.SaveLayoutToStream(Stream) Method

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

Namespace: DevExpress.XtraVerticalGrid

Assembly: DevExpress.XtraVerticalGrid.v24.2.dll

NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid

#Declaration

public virtual void SaveLayoutToStream(
    Stream 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.

#Example

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();
See Also