windowsforms-devexpress-dot-xtraverticalgrid-dot-vgridcontrolbase-dot-savelayouttoxml-x28-system-dot-string-x29.md
Using file paths sourced from untrusted input may expose unauthorized files or allow unintended file access. Always validate and normalize all external paths to prevent path manipulation.
Saves a vertical grid’s layout to an XML file.
Namespace : DevExpress.XtraVerticalGrid
Assembly : DevExpress.XtraVerticalGrid.v25.2.dll
NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid
public virtual void SaveLayoutToXml(
string xmlFile
)
Public Overridable Sub SaveLayoutToXml(
xmlFile As String
)
| Name | Type | Description |
|---|---|---|
| xmlFile | String |
A string value which specifies the path to the file where the vertical grid’s layout should be stored. If an empty string is specified, an exception is raised.
|
Use the SaveLayoutToXml method to save the vertical grid’s layout to a specific XML file at runtime. The saved settings can then be restored using the VGridControlBase.RestoreLayoutFromXml method.
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.
string filename = "c:\\XtraVerticalGridLayout.xml";
vGridControl1.SaveLayoutToXml(filename);
vGridControl2.DataSource = vGridControl1.DataSource;
vGridControl2.RestoreLayoutFromXml(filename);
Dim filename As String = "c:\XtraVerticalGridLayout.xml"
VGridControl1.SaveLayoutToXml(filename)
VGridControl2.DataSource = VGridControl1.DataSource
VGridControl2.RestoreLayoutFromXml(filename)
See Also