Version

GetRelatedVisibleColumn Method

Get the next/previous/first or last column in this band based on each column header's ColumnHeader.VisiblePosition.
Syntax
'Declaration
 
Public Function GetRelatedVisibleColumn( _
   ByVal relation As VisibleRelation _
) As UltraGridColumn
public UltraGridColumn GetRelatedVisibleColumn( 
   VisibleRelation relation
)

Parameters

relation
The relation the requested column has to this colum.

Return Value

The related column.
Example
Following code uses GetRelatedVisibleColumn method to print out column keys of all the visible columns in visible order of left to right.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
Imports System.Diagnostics

   Private Sub Button131_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button131.Click

       Dim column As UltraGridColumn = Me.UltraGrid1.DisplayLayout.Bands(0).Columns(0)

       Debug.WriteLine("Columns in visible order: ")

       ' Get the first visible column by passing in VisibleRelation.First.
       column = column.GetRelatedVisibleColumn(VisibleRelation.First)

       While Not column Is Nothing
           Debug.WriteLine("   " & column.Key)

           ' Get the next visible column by passing in VisibleRelation.Next.
           column = column.GetRelatedVisibleColumn(VisibleRelation.Next)
       End While

   End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

private void button131_Click(object sender, System.EventArgs e)
{

	UltraGridColumn column = this.ultraGrid1.DisplayLayout.Bands[0].Columns[0];

	Debug.WriteLine( "Columns in visible order: ");

	// Get the first visible column by passing in VisibleRelation.First.
	column = column.GetRelatedVisibleColumn( VisibleRelation.First );

	while ( null != column )
	{
		Debug.WriteLine( "   " + column.Key );

		// Get the next visible column by passing in VisibleRelation.Next.
		column = column.GetRelatedVisibleColumn( VisibleRelation.Next );
	}

}
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