Imports Infragistics.Win.UltraWinGrid
...
Class CustomMergedCellEvaluator
Implements Infragistics.Win.UltraWinGrid.IMergedCellEvaluator
Function ShouldCellsBeMerged(ByVal row1 As UltraGridRow, _
ByVal row2 As UltraGridRow, _
ByVal column As UltraGridColumn) As Boolean _
Implements IMergedCellEvaluator.ShouldCellsBeMerged
Dim date1 As DateTime = DirectCast(row1.GetCellValue(column), DateTime)
Dim date2 As DateTime = DirectCast(row2.GetCellValue(column), DateTime)
' Merge cells according to the date portions of the underlying DateTime cell
' values, ignoring any time portion. For example, "1/1/2004 10:30 AM" will be
' merged with "1/1/2004 1:15 AM" since the dates are the same.
Return date1.Date = date2.Date
End Function
End Class
Private Sub UltraGrid1_InitializeLayout(ByVal sender As Object, _
ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) _
Handles ultraGrid1.InitializeLayout
' Set the MergedCellStyle property to enable the merged cell functionality.
' MergedCellStyle also specifies which columns will merge their cells.
e.Layout.Override.MergedCellStyle = MergedCellStyle.Always
' MergedCellEvaluator property can be used to specify custom logic for
' merging cells.
e.Layout.Bands(0).Columns("ShippedDate").MergedCellEvaluator = _
New CustomMergedCellEvaluator()
End Sub