Back to Devexpress

SchedulerControl.SaveLayoutToStream(Stream) Method

windowsforms-devexpress-dot-xtrascheduler-dot-schedulercontrol-dot-savelayouttostream-x28-system-dot-io-dot-stream-x29.md

latest3.0 KB
Original Source

SchedulerControl.SaveLayoutToStream(Stream) Method

Saves the control’s layout to the specified stream.

Namespace : DevExpress.XtraScheduler

Assembly : DevExpress.XtraScheduler.v25.2.dll

NuGet Package : DevExpress.Win.Scheduler

Declaration

csharp
public void SaveLayoutToStream(
    Stream stream
)
vb
Public Sub SaveLayoutToStream(
    stream As Stream
)

Parameters

NameTypeDescription
streamStream

A Stream descendant to which the control’s layout is written.

|

Remarks

The SaveLayoutToStream method saves the control’s layout (the settings of all the Views, the type of the active View, grouping mode, etc) to the specified stream. The saved settings can then be restored from the storage using the SchedulerControl.RestoreLayoutFromStream method.

Tip

You can utilize the Persistence Behavior or Workspace Manager component to save and restore layouts for all supported DevExpress controls at once.

Example

The following example demonstrates how to save a scheduler’s layout to a memory stream and then restore it.

csharp
using System.IO;
// ...

Stream stream = new MemoryStream();
// ...

// Save the scheduler's layout.
stream.Seek(0, System.IO.SeekOrigin.Begin);
schedulerControl1.SaveLayoutToStream(stream);

// Load the scheduler's layout.
stream.Seek(0, System.IO.SeekOrigin.Begin);
schedulerControl1.RestoreLayoutFromStream(stream);
vb
Imports System.IO
' ...

Dim stream As System.IO.Stream
stream = New System.IO.MemoryStream()
' ...

' Save the scheduler's layout.
stream.Seek(0, System.IO.SeekOrigin.Begin)
SchedulerControl1.SaveLayoutToStream(stream)

' Load the scheduler's layout.
stream.Seek(0, System.IO.SeekOrigin.Begin)
SchedulerControl1.RestoreLayoutFromStream(stream)

See Also

Save and Restore Layouts of DevExpress controls

SchedulerControl Class

SchedulerControl Members

DevExpress.XtraScheduler Namespace