GridControl.RestoreLayoutFromXml(String) Method

Restores a grid's layout from the specified XML string.

Namespace: DevExpress.Mobile.DataGrid

Assembly: DevExpress.Mobile.Grid.v18.1.dll

Syntax

public void RestoreLayoutFromXml(string xmlContent)

Parameters

Type Name Description
String xmlContent

A string from which grid settings are read.

Use the RestoreLayoutFromXml method to load the previously saved grid layout to an XML sting with the GridControl.SaveLayoutToXml method.

Examples

The following sample code shows how to save the current layout of the grid to an XML string on a button click and restore it on another button click. The GridControl.SaveLayoutToXml and GridControl.RestoreLayoutFromXml methods are used.

string customState = String.Empty;

void SaveButton_Click(object sender, EventArgs e) {
    // Save the grid's layout.
    customState = grid.SaveLayoutToXml();
}

void LoadButton_Click(object sender, EventArgs e) {
    // Restore the previously saved layout.
    grid.RestoreLayoutFromXml(customState);
}

See Also