'宣言 Public ReadOnly Property Rows As RowsCollection
public RowsCollection Rows {get;}
Band が GroupBy モードの場合、Band で指定したフィールドの値 (列) に基づきバンドの Rows は GroupByRows の下でグループ化されます。ユーザーが列ヘッダーを Band の GroupByBox (Rows のグループ化で使用するためにフィールドを指定) にドラッグすると、グリッドの Rows は、グループ化で使用されるフィールドにある値を表す GroupByRows の下でグループ化されます。
各 GroupByRow は、同じグループ条件を共有するひとつ以上のデータ行を持ちます。GroupByRow の Rows プロパティは、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." ); } } }