'Declaration Public ReadOnly Property Rows As RowsCollection
public RowsCollection Rows {get;}
When a Band is in GroupBy mode, the Rows of the band are grouped together under GroupByRows, based on the values of specified fields (columns) in the Band. When the user drags a column header into the Band's GroupByBox (which specifies the field to use for grouping Rows) the Rows of the grid are grouped together under GroupByRows that represent the values found in the field being used for grouping.
Each GroupByRow will have one or more data rows that share the same grouping criteria. The Rows property of the GroupByRow returns a collection of all the data rows that appear under the GroupByRow.
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinGrid Imports System.Diagnostics Private Sub Button23_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button23.Click ' Loop throgh the rows. Dim i As Integer For i = 0 To Me.ultraGrid1.Rows.Count - 1 If TypeOf Me.ultraGrid1.Rows(i) Is UltraGridGroupByRow Then ' If the row is a group-by row, then print out the number of child rows it has. Dim groupByRow As UltraGridGroupByRow = DirectCast(Me.ultraGrid1.Rows(i), UltraGridGroupByRow) Debug.WriteLine(groupByRow.Value.ToString() & " has " & groupByRow.Rows.Count.ToString() & " number of child rows.") Else ' If the row is a regular row, then print out the number of child rows it has ' in "CustomerOrders" child band. Dim row As UltraGridRow = Me.ultraGrid1.Rows(i) Debug.WriteLine(row.Cells("CustomerID").Text & " has " & row.ChildBands("CustomersOrders").Rows.Count.ToString() & " number of child rows.") End If Next End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System.Diagnostics; private void button23_Click(object sender, System.EventArgs e) { // Loop throgh the rows. for ( int i = 0; i < this.ultraGrid1.Rows.Count; i++ ) { if ( this.ultraGrid1.Rows[i] is UltraGridGroupByRow ) { // If the row is a group-by row, then print out the number of child rows it has. UltraGridGroupByRow groupByRow = (UltraGridGroupByRow)this.ultraGrid1.Rows[i]; Debug.WriteLine( groupByRow.Value.ToString( ) + " has " + groupByRow.Rows.Count.ToString( ) + " number of child rows." ); } else { // If the row is a regular row, then print out the number of child rows it has // in "CustomersOrders" child band. UltraGridRow row = this.ultraGrid1.Rows[i]; Debug.WriteLine( row.Cells["CustomerID"].Text + " has " + row.ChildBands["CustomersOrders"].Rows.Count.ToString( ) + " number of child rows." ); } } }
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