See, you convert seconds into HH:MM:SS dynamically in the columns 3-5:
Private Sub Grid_CellDynamicContents(ByVal sender As Object, ByVal e As iGCellDynamicContentsEventArgs)
Select Case e.ColIndex
Case 3, 4, 5
If fGrid.Rows(e.RowIndex).Tag IsNot ("Subtotal:") Then
Dim iSpan As TimeSpan = TimeSpan.FromSeconds(e.Text)
e.Text = iSpan.Hours.ToString.PadLeft(2, "0"c) & ":" & iSpan.Minutes.ToString.PadLeft(2, "0"c) & ":" & iSpan.Seconds.ToString.PadLeft(2, "0"c)
End If
End Select
End Sub
, but you define totals only for the column with the index 5:
iGSubtotalManager.ShowSubtotals(fGrid, New Integer() {5})
In this case the the cells in the columns 3 and 4 in the subtotal rows return empty string, and you get the bug you reported.
To fix it, just define subtotals for the columns 3-5:
iGSubtotalManager.ShowSubtotals(fGrid, New Integer() {3, 4, 5})
***
But there is another problem in the CellDynamicContents event handler we're working on. To distinguish subtotal rows from normal ones, you should check whether their tag is "Subtotal" but not "Subtotal:" with colon at the end:
If fGrid.Rows(e.RowIndex).Tag IsNot ("Subtotal") Then
It's not a good idea to duplicate string constants everywhere in code, and to avoid this you can even use a special method of iGSubtotalManager to check whether a row is a subtotal row :
If Not iGSubtotalManager.IsSubtotal(fGrid.Rows(e.RowIndex)) Then
***
All is good now, but in fact you do not need this check whether a row is a subtotal one or not if you wish to format total values as HH:MM:SS too. So your event handler should be so simple like this:
Private Sub Grid_CellDynamicContents(ByVal sender As Object, ByVal e As iGCellDynamicContentsEventArgs)
Select Case e.ColIndex
Case 3, 4, 5
Dim iSpan As TimeSpan = TimeSpan.FromSeconds(e.Text)
e.Text = iSpan.Hours.ToString.PadLeft(2, "0"c) & ":" & iSpan.Minutes.ToString.PadLeft(2, "0"c) & ":" & iSpan.Seconds.ToString.PadLeft(2, "0"c)
End Select
End Sub