Private Sub grdUserReports_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles grdUserReports.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
Dim rowTotal As Integer = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "Target"))
If rowTotal <> 0 Then
grdTotal = grdTotal + rowTotal
End If
End If
If e.Row.RowType = DataControlRowType.Footer Then
Dim lbl As Label = DirectCast(e.Row.FindControl("lblTotal"), Label)
lbl.Text = grdTotal.ToString("c")
End If
End Sub

Danish HabibPosted Apr 30, 2015, 1:13 AM