Private Sub btnSave_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnSave.Click Me.UltraGrid1.DisplayLayout.SaveAsXml("WinGridLayout.xml") End Sub
Layout の SaveAsXml メソッドと LoadFromXml メソッドは WinGrid のレイアウトを Xml ファイルに保存します。
Visual Basic の場合:
Private Sub btnSave_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnSave.Click Me.UltraGrid1.DisplayLayout.SaveAsXml("WinGridLayout.xml") End Sub
C# の場合:
private void btnSave_Click(object sender, System.EventArgs e) { this.ultraGrid1.DisplayLayout.SaveAsXml("WinGridLayout.xml"); }
レイアウトをグリッドにロードする操作は保存と類似しています。
Visual Basic の場合:
Private Sub btnLoad_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnLoad.Click Me.UltraGrid1.DisplayLayout.LoadFromXml(System.IO.Path.Combine( _ Application.StartupPath, "..\ExtraFiles\WinGridLayout.xml")) End Sub
C# の場合:
private void btnLoad_Click(object sender, System.EventArgs e) { this.ultraGrid1.DisplayLayout.LoadFromXml(System.IO.Path.Combine( Application.StartupPath, @"..\..\ExtraFiles\WinGridLayout.xml")); }