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