VGridControlBase.SaveLayoutToStream(Stream) Method
Saves a vertical grid’s layout to the specified stream.
Namespace: DevExpress.XtraVerticalGrid
Assembly: DevExpress.XtraVerticalGrid.v24.1.dll
NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid
Declaration
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();