1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
Private totalFacture As Decimal = 0
Private Sub gvFactures_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvFactures.RowDataBound
Dim row As GridViewRow = e.Row
Dim lblvg As Label
If row.RowType = DataControlRowType.DataRow Then
lblvg = CType(row.FindControl("lblMontant"), Label)
totalFacture = totalFacture + Convert.ToDecimal(lblvg.Text)
lblvg.Text = "Montant : " & lblvg.Text
End If
End Sub
Private Sub gvFactures_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvFactures.RowCreated
Dim row As GridViewRow = e.Row
If row.RowType = DataControlRowType.Footer Then
Dim lblvg As Label = CType(row.FindControl("lblTotal"), Label)
If totalFacture > 0 Then
lblvg.Text = "Total facturé : " & totalFacture
Else
lblvg.Visible = False
End If
End If
End Sub |
Partager