'宣言 Public Overloads Sub SaveAsXml( _ ByVal filename As String, _ ByVal includeData As Boolean _ )
public void SaveAsXml( string filename, bool includeData )
SaveAsBinary メソッドは、UltraDataSource のプロパティ設定およびレイアウトを永続化するために LoadFromXml(String,Boolean) メソッドと組み合わせて使用します。
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinDataSource Private Sub SaveButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles saveButton.Click ' Following code saves the data to an XML file for loading at ' a later time. Dim saveFileDlg As SaveFileDialog = New SaveFileDialog() saveFileDlg.Filter = "XML File|*.xml" saveFileDlg.OverwritePrompt = True Dim dialogResult As DialogResult = saveFileDlg.ShowDialog(Me) If dialogResult.OK = dialogResult Then ' Pass in true for the includeData parameter to save the data ' otherwise it will only save the structure. ' Me.ultraDataSource1.SaveAsXml(saveFileDlg.FileName, True) End If End Sub Private Sub LoadButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles loadButton.Click ' Following code loads previously saved data from a file. Dim openFileDlg As OpenFileDialog = New OpenFileDialog() openFileDlg.Filter = "XML File|*.xml" Dim dialogResult As DialogResult = openFileDlg.ShowDialog(Me) If dialogResult.OK = dialogResult Then ' Pass in true for the includeData parameter to load the data ' and not just the structure. ' Me.ultraDataSource1.LoadFromXml(openFileDlg.FileName, True) End If End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinDataSource; using System.Diagnostics; private void saveButton_Click(object sender, System.EventArgs e) { // Following code saves the data to an XML file for loading at // a later time. SaveFileDialog saveFileDlg = new SaveFileDialog( ); saveFileDlg.Filter = "XML File|*.xml"; saveFileDlg.OverwritePrompt = true; DialogResult dialogResult = saveFileDlg.ShowDialog( this ); if ( DialogResult.OK == dialogResult ) { // Pass in true for the includeData parameter to save the data // otherwise it will only save the structure. // this.ultraDataSource1.SaveAsXml( saveFileDlg.FileName, true ); } } private void loadButton_Click(object sender, System.EventArgs e) { // Following code loads previously saved data from a file. OpenFileDialog openFileDlg = new OpenFileDialog( ); openFileDlg.Filter = "XML File|*.xml"; DialogResult dialogResult = openFileDlg.ShowDialog( this ); if ( DialogResult.OK == dialogResult ) { // Pass in true for the includeData parameter to load the data // and not just the structure. // this.ultraDataSource1.LoadFromXml( openFileDlg.FileName, true ); } }