Back to Devexpress

BaseView.RestoreLayoutFromStream(Stream, OptionsLayoutBase) Method

windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-baseview-dot-restorelayoutfromstream-x28-system-dot-io-dot-stream-devexpress-dot-utils-dot-optionslayoutbase-x29.md

latest4.2 KB
Original Source

BaseView.RestoreLayoutFromStream(Stream, OptionsLayoutBase) Method

SECURITY-RELATED CONSIDERATIONS

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

Restores the View’s layout using the specified settings which are stored in the specified stream.

Namespace : DevExpress.XtraGrid.Views.Base

Assembly : DevExpress.XtraGrid.v25.2.dll

NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

csharp
public void RestoreLayoutFromStream(
    Stream stream,
    OptionsLayoutBase options
)
vb
Public Sub RestoreLayoutFromStream(
    stream As Stream,
    options As OptionsLayoutBase
)

Parameters

NameTypeDescription
streamStream

A Stream descendant containing the layout settings.

| | options | OptionsLayoutBase |

A OptionsLayoutBase descendant specifying which options should be restored.

|

Remarks

Use the RestoreLayoutFromStream method to restore a layout written to a stream by the BaseView.SaveLayoutToStream method. If the specified stream is empty or null ( Nothing in Visual Basic), an exception is raised.

The options parameter determines which options should be restored from the stream. For the grid control you can create a OptionsLayoutGrid object, customize it as required and then pass it as the options parameter. Only the options that are enabled in this object will be restored

Specific options which are disabled in the options parameter are not affected.

To restore all the options pass null or the static OptionsLayoutBase.FullLayout property as the options parameter.

The RestoreLayoutFromStream overload without the options parameter restores only the options which are specified by the ColumnView.OptionsLayout property.

Note

When restoring a layout during a form load (for instance, in your Form.Load event handler), you may need to call the GridControl.ForceInitialize method prior to the layout restoration. See this method to learn more.

See Also

SaveLayoutToStream

RestoreLayoutFromRegistry

RestoreLayoutFromXml

OptionsLayout

LayoutUpgrade

Save and Restore Grid Layout

Save and Restore Layouts of DevExpress controls

BaseView Class

BaseView Members

DevExpress.XtraGrid.Views.Base Namespace