Back to Devexpress

VGridControlBase.RestoreLayoutFromXml(String) Method

windowsforms-devexpress-dot-xtraverticalgrid-dot-vgridcontrolbase-dot-restorelayoutfromxml-x28-system-dot-string-x29.md

latest3.3 KB
Original Source

VGridControlBase.RestoreLayoutFromXml(String) 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 a vertical grid’s layout from the specified XML file.

Namespace : DevExpress.XtraVerticalGrid

Assembly : DevExpress.XtraVerticalGrid.v25.2.dll

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

Declaration

csharp
public virtual void RestoreLayoutFromXml(
    string xmlFile
)
vb
Public Overridable Sub RestoreLayoutFromXml(
    xmlFile As String
)

Parameters

NameTypeDescription
xmlFileString

A string value which specifies the path to the XML file from which the vertical grid’s settings are read. If the specified file doesn’t exist, an exception is raised.

|

Remarks

Use the RestoreLayoutFromXml method to load the vertical grid’s layout which was written to a file in the XML format using the VGridControlBase.SaveLayoutToXml method.

Example

The following sample code saves the vertical grid’s layout to an XML file and then applies it to another vertical grid control. The VGridControlBase.SaveLayoutToXml and VGridControlBase.RestoreLayoutFromXml methods are used for this purpose.

csharp
string filename = "c:\\XtraVerticalGridLayout.xml";
vGridControl1.SaveLayoutToXml(filename);
vGridControl2.DataSource = vGridControl1.DataSource;
vGridControl2.RestoreLayoutFromXml(filename);
vb
Dim filename As String = "c:\XtraVerticalGridLayout.xml"
VGridControl1.SaveLayoutToXml(filename)
VGridControl2.DataSource = VGridControl1.DataSource
VGridControl2.RestoreLayoutFromXml(filename)

See Also

RestoreLayoutFromRegistry

RestoreLayoutFromStream

Save and Restore Layouts of DevExpress controls

VGridControlBase Class

VGridControlBase Members

DevExpress.XtraVerticalGrid Namespace