Infragistics(R) NetAdvantage(R) Windows Forms
GetRowEnumerator Method
See Also  Example E-mail your feedback on this topic.
Infragistics.Win.UltraWinGrid Namespace > UltraGridBand Class : GetRowEnumerator Method

rowTypes
Whether to get data rows or group-by rows or both.
Gets the rows associated with this band.

Syntax

Visual Basic (Declaration) 
Public Function GetRowEnumerator( _
   ByVal rowTypes As GridRowType _
) As IEnumerable
C# 
public IEnumerable GetRowEnumerator( 
   GridRowType rowTypes
)

Parameters

rowTypes
Whether to get data rows or group-by rows or both.

Return Value

Returns an IEnumerable instance that can be used to enumerate all the rows associated with this band.

Example

The following code will get an enumerator that will loop through every row in Band 1 of the grid. This will span across multiple islands groupings, but no GroupBy rows will be returned.

Visual BasicCopy Code
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 only Data rows. GroupBy rows will be skipped.
Dim rowTypes As GridRowType = GridRowType.DataRow

' Get a Row Enumerator that will return all rows in the 
' first child band.
' Note that this will not just return a single island of data. 
' It will get every row in the child band. This means the child of 
' every row in it's direct parent band.
Dim band As UltraGridBand = Me.ultraGrid1.DisplayLayout.Bands(1)
Dim enumerator As IEnumerable = band.GetRowEnumerator(rowTypes)

Dim row As UltraGridRow
For Each row In enumerator
    ' Since this enumerator will only return data rows, we can 
    ' assume each row will have at least one cell. 
    Debug.WriteLine(row.Cells(0).Value)
Next
C#Copy Code
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 only Data rows. GroupBy rows will be skipped.
GridRowType rowTypes = GridRowType.DataRow;		

// Get a Row Enumerator that will return all rows in the 
// first child band.
// Note that this will not just return a single island of data. 
// It will get every row in the child band. This means the child of 
// every row in it's direct parent band.
UltraGridBand band = this.ultraGrid1.DisplayLayout.Bands[1];
IEnumerable enumerator = band.GetRowEnumerator(rowTypes);

foreach (UltraGridRow row in enumerator)
{	
	// Since this enumerator will only return data rows, we can 
	// assume each row will have at least one cell. 
	Debug.WriteLine(row.Cells[0].Value);
}

Remarks

See Also