BaseView.RestoreLayoutFromXml(String, OptionsLayoutBase) Method

Restores the View's layout using the specified settings from the specified XML file.

Namespace: DevExpress.XtraGrid.Views.Base

Assembly: DevExpress.XtraGrid.v20.1.dll


public void RestoreLayoutFromXml(
    string xmlFile,
    OptionsLayoutBase options
Public Sub RestoreLayoutFromXml(
    xmlFile As String,
    options As OptionsLayoutBase


Name Type Description
xmlFile String

A string value specifying the path to the XML file which contains the layout settings. If the specified file doesn't exist a System.IO.FileNotFoundException type exception is raised.

options OptionsLayoutBase

A OptionsLayoutBase descendant specifying which options should be restored.


Use the RestoreLayoutFromXml method to restore a View's layout which was written to a file in XML format using the BaseView.SaveLayoutToXml method.

The options parameter determines which options should be restored from the XML file. 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 a static OptionsLayoutBase.FullLayout property as the options parameter.

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


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