wpf-devexpress-dot-xpf-dot-grid-dot-datacontrolbase-dot-restorelayoutfromxml-x28-system-dot-string-x29.md
Deserializing layout settings from untrusted resources may create security issues. Review the following help topic for additional information: Safe Deserialization.
Restores a control’s layout from the specified XML file.
Namespace : DevExpress.Xpf.Grid
Assembly : DevExpress.Xpf.Grid.v25.2.Core.dll
NuGet Package : DevExpress.Wpf.Grid.Core
public void RestoreLayoutFromXml(
string path
)
Public Sub RestoreLayoutFromXml(
path As String
)
| Name | Type | Description |
|---|---|---|
| path | String |
A String value that specifies the target file name.
|
To save a control’s layout to an XML file, use the DataControlBase.SaveLayoutToXml
Note
Detail grids aren’t automatically serialized when saving the master grid’s layout. To learn more, see Master-Detail Mode Limitations.
To learn more, see Saving and Restoring Layout.
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the RestoreLayoutFromXml(String) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
void OnRestoreLayout(object sender, RoutedEventArgs e) {
grid.RestoreLayoutFromXml("layout.xml");
}
Private Sub OnRestoreLayout(ByVal sender As Object, ByVal e As RoutedEventArgs)
Me.grid.RestoreLayoutFromXml("layout.xml")
End Sub
See Also