The LoadFromXml method is used in conjunction with the SaveAsXml(Stream) method to persist the structure and data of the ultraDataSource.
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinDataSource Dim memoryStream As System.IO.MemoryStream = Nothing Private Sub SaveButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles saveButton.Click Me.memoryStream = New System.IO.MemoryStream() ' Save data to a stream. Pass in true for the includeData parameter ' to save data and not just the structure. Me.ultraDataSource1.SaveAsBinary(Me.memoryStream, True) End Sub Private Sub ClearDataSource_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles clearDataSource.Click Me.UltraDataSource1.Rows.Clear() End Sub Private Sub LoadButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles loadButton.Click ' Make sure the Position is set to a location where the saved data ' begins. Me.MemoryStream.Position = 0 ' Retrieve previously saved data from the stream. Pass in true for ' the includeData parameter to save data and not just the structure. Me.UltraDataSource1.LoadFromBinary(Me.MemoryStream, True) End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinDataSource; using System.Diagnostics; System.IO.MemoryStream memoryStream = null; private void saveButton_Click(object sender, System.EventArgs e) { this.memoryStream = new System.IO.MemoryStream( ); // Save data to a stream. Pass in true for the includeData parameter // to save data and not just the structure. this.ultraDataSource1.SaveAsBinary( this.memoryStream, true ); } private void clearDataSource_Click(object sender, System.EventArgs e) { this.ultraDataSource1.Rows.Clear( ); } private void loadButton_Click(object sender, System.EventArgs e) { // Make sure the Position is set to a location where the saved data // begins. this.memoryStream.Position = 0; // Retrieve previously saved data from the stream. Pass in true for // the includeData parameter to save data and not just the structure. this.ultraDataSource1.LoadFromBinary( this.memoryStream, 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