The LoadFromBinary method is used in conjunction with the SaveAsBinary(String) method to persist the structure and data of the ultraDataSource.
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 ); } }
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2