Version

GetRowEnumerator Method (RowsCollection)

Gets the rows associated with this rows collection as well as descendant row collections upto the lowestLevelBand.
Syntax
'Declaration
 
Public Function GetRowEnumerator( _
   ByVal rowTypes As GridRowType, _
   ByVal bandToMatch As UltraGridBand, _
   ByVal lowestLevelBand As UltraGridBand _
) As IEnumerable
public IEnumerable GetRowEnumerator( 
   GridRowType rowTypes,
   UltraGridBand bandToMatch,
   UltraGridBand lowestLevelBand
)

Parameters

rowTypes
Whether to get data rows or group-by rows or both.
bandToMatch
If this parameter is non-null then rows from only this band will be returned. If it is null, then rows from all bands will be returned.
lowestLevelBand
If this parameter is non-null then rows from bands upto the lowestLevelBand (inclusive) will be returned. If bandToMatch is specified as non-null then this will be ignored.

Return Value

Returns an IEnumerable instance that can be used to enumerate the rows. Note that you can use a for each loop to traverse the rows.
Example
The following code will get an enumerator that will loop through every row in the grid on every level of the hierarchy including GroupBy rows.

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid

' Row Types indicates which types of rows are enumerated: Data rows, GroupBy rows, or both. 
' In this case, return both. 
Dim rowTypes As GridRowType = GridRowType.DataRow Or GridRowType.GroupByRow

' Get a Row Enumerator that will return all rows in the entire grid.
' This includes all rows in the root band as well as all child bands down
' to the lowest level. 
Dim enumerator As IEnumerable = Me.ultraGrid1.Rows.GetRowEnumerator(rowTypes, Nothing, Nothing)
Dim row As UltraGridRow
For Each row In enumerator
    ' Since this enumerator can return Data rows or GroupBy rows, 
    ' check IsGroupByRow to determine which one we are dealing with.
    If (row.IsGroupByRow) Then
Debug.WriteLine(row.Description)
    Else
Debug.WriteLine(row.Cells(0).Value)
    End If
Next
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;

// Row Types indicates which types of rows are enumerated: Data rows, GroupBy rows, or both. 
// In this case, return both. 
GridRowType rowTypes = GridRowType.DataRow | GridRowType.GroupByRow;

// Get a Row Enumerator that will return all rows in the entire grid.
// This includes all rows in the root band as well as all child bands down
// to the lowest level. 
IEnumerable enumerator = this.ultraGrid1.Rows.GetRowEnumerator(rowTypes, null, null);
foreach (UltraGridRow row in enumerator)
{
	// Since this enumerator can return Data rows or GroupBy rows, 
	// check IsGroupByRow to determine which one we are dealing with.
	if (row.IsGroupByRow)
		Debug.WriteLine(row.Description);
	else
		Debug.WriteLine(row.Cells[0].Value);
}
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