1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Public Sub Footer_total(ByRef grid As GridView, ByVal col_debu As Integer, Optional ByVal col_fin As Integer = 0) ' As Integer
If grid.Rows.Count - 1 > 0 Then
Dim total As Double = 0 'integer
If col_fin = 0 Then
col_fin = col_debu
End If
Try
For i As Integer = col_debu To col_fin
For j As Integer = 0 To grid.Rows.Count - 1
If IsNumeric(grid.Rows(j).Cells(i).Text) Then
total += grid.Rows(j).Cells(i).Text
End If
Next
grid.FooterRow.Cells(i).Text = String.Format("{0:N3}", total)
total = 0
Next
Catch ex As Exception
MsgBox("Footer_total : " & ex.Message)
_errormsg &= "Footer_total : " & ex.Message & " <br/>"
End Try
End If
End Sub |
Partager