Version

GetRowAtVisibleIndexOffset Method

Gets a row based on a start row and a relative visible index.
Overload List
OverloadDescription
GetRowAtVisibleIndexOffset(UltraGridRow,Int32)Gets a row based on a start row and a relative visible index.  
Example
Following code shows how GetRowAtVisibleIndex, GetRowAtVisibleIndexOffset methods and VisibleIndex property work and relate to each other. It gets the 6th visible row using GetRowAtVisibleIndex method and highlights it with red color. Then it gets the 2nd row after that row using GetRowAtVisibleIndexOffset method and highlights that with green color. NOTE: Below code assumes the UltraGrid has more than seven rows.

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

   Private Sub Button86_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button86.Click

       ' Get the 6th (visible indexes start at 0 as well) visible row.
       Dim row1 As UltraGridRow = Me.UltraGrid1.Rows.GetRowAtVisibleIndex(5)

       ' Highlight the row with Red for easy identification in the UltraGrid.
       row1.Appearance.BackColor = Color.Red

       ' This should write out 5 as the visible index.
       Debug.WriteLine("Row 1 VisibleIndex = " & row1.VisibleIndex)

       ' Using GetRowAtVisibleIndexOffset method, get the 2nd row after row1.
       Dim row2 As UltraGridRow = Me.UltraGrid1.Rows.GetRowAtVisibleIndexOffset(row1, 2)

       ' Highlight the row with Green for easy identification in the UltraGrid.
       row2.Appearance.BackColor = Color.Green

       ' This should write out 7 as the visible index.
       Debug.WriteLine("Row 2 VisibleIndex = " & row2.VisibleIndex)

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

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

	// Get the 6th (visible indexes start at 0 as well) visible row.
	UltraGridRow row1 = this.ultraGrid1.Rows.GetRowAtVisibleIndex( 5 );

	// Highlight the row with Red for easy identification in the UltraGrid.
	row1.Appearance.BackColor = Color.Red;

	// This should write out 5 as the visible index.
          Debug.WriteLine( "Row 1 VisibleIndex = " + row1.VisibleIndex );

	// Using GetRowAtVisibleIndexOffset method, get the 2nd row after row1.
	UltraGridRow row2 = this.ultraGrid1.Rows.GetRowAtVisibleIndexOffset( row1, 2 );
	
	// Highlight the row with Green for easy identification in the UltraGrid.
	row2.Appearance.BackColor = Color.Green;

	// This should write out 7 as the visible index.
	Debug.WriteLine( "Row 2 VisibleIndex = " + row2.VisibleIndex );

}
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