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

SchedulerControl.RestoreLayoutFromStream(Stream) Method

SECURITY NOTE

Deserializing layout settings from untrusted resources may create security issues. Review the following help topic for additional information: Safe Deserialization.

Restores the control’s layout from the specified stream.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v24.2.dll

NuGet Package: DevExpress.Win.Scheduler

#Declaration

public void RestoreLayoutFromStream(
    Stream stream
)

#Parameters

Name Type Description
stream Stream

A Stream descendant from which settings are read.

#Remarks

Use the RestoreLayoutFromStream method to load the control’s layout from the stream to which the layout was saved via the SchedulerControl.SaveLayoutToStream method. If the specified stream is empty or null (Nothing in Visual Basic), an exception is raised.

#Example

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

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