Back to Devexpress

How to: Save and Restore a Layout

windowsforms-2264-controls-and-libraries-scheduler-examples-layout-how-to-save-and-restore-a-layout.md

latest937 B
Original Source

How to: Save and Restore a Layout

  • Nov 13, 2018

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)