Infragistics(R) NetAdvantage(R) Windows Forms
SiblingRow Enumeration
Example  See Also  E-mail your feedback on this topic.
Infragistics.Win.UltraWinGrid Namespace : SiblingRow Enumeration

Used to specify the relationship between the current row and its sibling rows.

Syntax

Visual Basic (Declaration) 
Public Enum SiblingRow 
   Inherits System.Enum
C# 
public enum SiblingRow : System.Enum 

Members

MemberDescription
First First Sibling. Row is the first sibling in the current row's band.
Last Last Sibling. Row is the last sibling in the current row's band.
Next Next Sibling. Row is the next sibling in the current row's band.
Previous Previous Sibling. Row is the previous sibling in the current row's band.

Example

Following code shows how to loop through rows using GetSibling, HasNextSibling and HasPrevSibling methods.

Visual BasicCopy Code
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
Imports System.Diagnostics

   Private Sub Button72_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button72.Click

       ' Following code loops throug all the top level rows in the UltraGrid.
       ' It prints out the row indexes for illustration purposes.

       ' Get the first row in the UltraGrid.
       Dim row As UltraGridRow = Me.ultraGrid1.GetRow(ChildRow.First)

       ' Write the index of the row.
       Debug.WriteLine("" & row.Index)

       While row.HasNextSibling(True, False)
           row = row.GetSibling(SiblingRow.Next, True, False)

           ' Write the index of the row.
           Debug.WriteLine("" & row.Index)
       End While

   End Sub


   Private Sub Button73_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button73.Click

       ' Following code loops throug all the top level rows in the UltraGrid backwards.
       ' It prints out the row indexes for illustration purposes.

       ' Get the last row in the UltraGrid.
       Dim row As UltraGridRow = Me.ultraGrid1.GetRow(ChildRow.Last)

       ' Write the index of the row.
       Debug.WriteLine("" & row.Index)

       While row.HasPrevSibling(True, False)
           row = row.GetSibling(SiblingRow.Previous, True, False)

           ' Write the index of the row.
           Debug.WriteLine("" & row.Index)
       End While

   End Sub
C#Copy Code
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

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

	// Following code loops throug all the top level rows in the UltraGrid.
	// It prints out the row indexes for illustration purposes.

	// Get the first row in the UltraGrid.
	UltraGridRow row = this.ultraGrid1.GetRow( ChildRow.First );

	// Write the index of the row.
	Debug.WriteLine( "" + row.Index );

	while ( row.HasNextSibling( true, false ) )
	{
		row = row.GetSibling( SiblingRow.Next, true, false );

		// Write the index of the row.
		Debug.WriteLine( "" + row.Index );
	}

}

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

	// Following code loops throug all the top level rows in the UltraGrid backwards.
	// It prints out the row indexes for illustration purposes.

	// Get the last row in the UltraGrid.
	UltraGridRow row = this.ultraGrid1.GetRow( ChildRow.Last );

	// Write the index of the row.
	Debug.WriteLine( "" + row.Index );

	while ( row.HasPrevSibling( true, false ) )
	{
		row = row.GetSibling( SiblingRow.Previous, true, false );

		// Write the index of the row.
		Debug.WriteLine( "" + row.Index );
	}

}

Remarks

The SiblingRow enum is used for specifying parameter to various methods like the UltraGridRow.GetSibling method.

See Also