The Index property returns the location of this column in the UltraDataColumnsCollection that this column belongs to. This property returns the same value as the UltraDataColumnsCollection.IndexOf method of the UltraDataColumnsCollection.
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinDataSource Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim column As UltraDataColumn = Me.ultraDataSource1.Band.Columns(1) Dim index1 As Integer = Me.ultraDataSource1.Band.Columns.IndexOf(column) Dim index2 As Integer = column.Index ' Following two lines should print out the same index. Debug.WriteLine("Index1 = " & index1) Debug.WriteLine("Index2 = " & index2) End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinDataSource; using System.Diagnostics; private void button1_Click(object sender, System.EventArgs e) { UltraDataColumn column = this.ultraDataSource1.Band.Columns[1]; int index1 = this.ultraDataSource1.Band.Columns.IndexOf( column ); int index2 = column.Index; // Following two lines should print out the same index. Debug.WriteLine( "Index1 = " + index1 ); Debug.WriteLine( "Index2 = " + index2 ); }
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