Version

SaveAsXml(String) Method

Saves UltraListView data into the specified file in XML (Soap) format.
Syntax
'Declaration
 
Public Overloads Sub SaveAsXml( _
   ByVal filename As String _
) 
public void SaveAsXml( 
   string filename
)

Parameters

filename
The name of the file to write.
Remarks

This method saves the data which can be loaded by the LoadFromXml(String) method.

Example
The following code sample demonstrates how to use the UltraListView's SaveAsXml, SaveAsBinary, LoadFromXml, and LoadFromBinary methods to persist the state of the control when a Form closes and restore it when the Form is loaded:

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinListView

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Me.ultraListView1.Reset();

        If System.IO.File.Exists("UltraListView.xml") Then
            Me.ultraListView1.LoadFromXml("UltraListView.xml")
        Else
            Me.ultraListView1.LoadFromBinary("UltraListView.bin")
        End If
	 End Sub


    Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
        If saveAsXml Then
            Me.ultraListView1.SaveAsXml("UltraListView.xml")
        Else
            Me.ultraListView1.SaveAsBinary("UltraListView.bin")
        End If
    End Sub
using Infragistics.Win;
using Infragistics.Win.UltraWinListView;
using System.Diagnostics;
using System.IO;

		private void Form1_Load(object sender, System.EventArgs e)
		{
			this.ultraListView1.Reset();

			if ( File.Exists("UltraListView.xml") )
				this.ultraListView1.LoadFromXml( "UltraListView.xml" );
			else
			if ( File.Exists("UltraListView.bin") )
				this.ultraListView1.LoadFromBinary( "UltraListView.bin" );

		}


		private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
		{
			if ( this.saveAsXml )
				this.ultraListView1.SaveAsXml( "UltraListView.xml" );
			else
				this.ultraListView1.SaveAsBinary( "UltraListView.bin" );
		}
Requirements

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

See Also