DataGridView.RestoreLayoutFromXml(String) Method
In This Article
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
C#
public void RestoreLayoutFromXml(
string xmlContent
)
#Parameters
Name | Type | Description |
---|---|---|
xml |
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