バージョン

UltraGridGroupByRow クラス

グリッドに表示されるGroupBy行を表すクラスです。
シンタックス
'宣言
 
Public NotInheritable Class UltraGridGroupByRow 
   Inherits UltraGridSpecialRowBase
   Implements Infragistics.Shared.ISelectableItem, Infragistics.Shared.ISparseArrayItem, Infragistics.Shared.ISparseArrayMultiItem, Infragistics.Win.IUIElementProvider, Infragistics.Win.IUIElementTextProvider 
public sealed class UltraGridGroupByRow : UltraGridSpecialRowBase, Infragistics.Shared.ISelectableItem, Infragistics.Shared.ISparseArrayItem, Infragistics.Shared.ISparseArrayMultiItem, Infragistics.Win.IUIElementProvider, Infragistics.Win.IUIElementTextProvider  
解説

GroupBy Row は、GroupBy モードに置かれ、グループ化データで指定される少なくともひとつのフィールドを持つグリッドの Band に表示されます。GroupBy Rows は、複数フィールドのデータを表示しないことを除き正規のグリッド行と同じです。その代わりに、属するグループに基づいてデータの個別行の役割を果たします。GroupBy Row は、データをグループ化するために使用されるフィールドのデータ値だけを表示します。

たとえば、アドレス データが含まれる Band を持ち、City フィールドの値に基づいてデータをグループ化するために GroupBy モードを使用する場合、データに表示されるすべての市で GroupBy Row が表示されます。GroupBy Row は各市の名前だけを表示します。以降の各 GroupBy Row は、GroupBy Row に表示される City フィールと同じ値を含むすべてのデータ レコードになります。

GroupBy Rows は、特定の値に対応する行を表示または非表示にするために展開または縮小することができます。GroupBy Row は、行を展開および縮小するために必要なユーザー インターフェイス要素も含みます。プログラムで、このオブジェクトを使用して、グループ化を展開するかどうかや GroupBy Row でグループ化する行数などの行のグループの状態についての情報を見つけることができます。

使用例
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
Imports System.Diagnostics

   Private Sub UltraGrid1_InitializeGroupByRow(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeGroupByRowEventArgs) Handles ultraGrid1.InitializeGroupByRow

       ' ReInitialize indicates whether the row is being initialized for the first time
       ' or it's being re-initialized.
       If e.ReInitialize Then
           Debug.WriteLine("A group-by row is being re-initilaized.")
       Else
           Debug.WriteLine("A group-by row is being initilaized.")
       End If

       ' Set the description to desired value. This is the text that shows up on
       ' the group-by row.
       e.Row.Description = e.Row.Value.ToString() & ", " & e.Row.Rows.Count & " Items."

       ' We only want to do this if we are grouping by the Country column.
       If e.Row.Column.Key = "Country" Then
           ' If the group has more than 5 items, then make the background color 
           ' of the row to red
           If e.Row.Rows.Count > 5 Then
               e.Row.Appearance.BackColor = Color.Red
           Else
               e.Row.Appearance.ResetBackColor()
           End If
       End If

   End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

private void ultraGrid1_InitializeGroupByRow(object sender, Infragistics.Win.UltraWinGrid.InitializeGroupByRowEventArgs e)
{

	// ReInitialize indicates whether the row is being initialized for the first time
	// or it's being re-initialized.
	if ( e.ReInitialize )
		Debug.WriteLine( "A group-by row is being re-initilaized." );
	else
		Debug.WriteLine( "A group-by row is being initilaized." );

	// Set the description to desired value. This is the text that shows up on
	// the group-by row.
	e.Row.Description = e.Row.Value.ToString( ) + ", " + e.Row.Rows.Count + " Items.";

	// We only want to do this if we are grouping by the Country column.
	if ( e.Row.Column.Key == "Country" )
	{
		// If the group has more than 5 items, then make the background color 
		// of the row to red
		if ( e.Row.Rows.Count > 5 )
		{
			e.Row.Appearance.BackColor = Color.Red;
		}
		else
		{
			e.Row.Appearance.ResetBackColor( );
		}
	}

}
参照