Skip to main content

DataGridView.RestoreLayoutFromXml(String) Method

Restores the grid’s layout from the specified XML string.

Namespace: DevExpress.XamarinForms.DataGrid

Assembly: DevExpress.XamarinForms.Grid.dll

NuGet Package: DevExpress.XamarinForms.Grid

Declaration

public void RestoreLayoutFromXml(
    string xmlContent
)

Parameters

Name Type Description
xmlContent String

A string from which the grid’s settings are read.

Remarks

Use the RestoreLayoutFromXml method to load the grid’s layout saved to an XML sting with the SaveLayoutToXml method.

Example

This example shows how to use the SaveLayoutToXml and RestoreLayoutFromXml methods to save the current layout of the grid to an XML string when you click a button and restore it when you click another button.

using DevExpress.XamarinForms.DataGrid;
// ...

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