'宣言 Public Delegate Sub InitializeGroupByRowEventHandler( _ ByVal sender As Object, _ ByVal e As InitializeGroupByRowEventArgs _ )
public delegate void InitializeGroupByRowEventHandler( object sender, InitializeGroupByRowEventArgs e )
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( ); } } }