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

LayoutControl.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 layout from the specified stream.

Namespace: DevExpress.XtraLayout

Assembly: DevExpress.XtraLayout.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

public virtual void RestoreLayoutFromStream(
    Stream stream
)

#Parameters

Name Type Description
stream Stream

A Stream descendant from which the layout is read. If null (Nothing in Visual Basic), an exception is raised.

#Remarks

The LayoutControl.SaveLayoutToStream method saves the Layout Control’s layout to a stream. You can then restore this layout using the RestoreLayoutFromStream method.

See Save and Restore Layout to learn more.

#Example

The following sample code saves the current layout to a memory stream and then restores it.

System.IO.Stream stream;
stream = new System.IO.MemoryStream();
layoutControl1.SaveLayoutToStream(stream);
stream.Seek(0, System.IO.SeekOrigin.Begin);

// ...
layoutControl1.RestoreLayoutFromStream(stream);
stream.Seek(0, System.IO.SeekOrigin.Begin);
See Also