I have a column named Rate and another Named LaborHours
The rate column can be two values: REGULAR and OVERTIME
I want the to totals in the footer: REGULAR 5, OVERTIME 10
The code below works in my MS DataGrid, cannot figure out how to get it to work under RadGrid
You help is much appreciated!
If e.Row.RowType = DataControlRowType.DataRow Then
Dim MilesOrHours As String
MilesOrHours = (DataBinder.Eval(e.Row.DataItem, "Rate"))
If MilesOrHours = "MI" Then
Dim HourTotal As Decimal
HourTotal = (DataBinder.Eval(e.Row.DataItem, "LaborHours"))
grdMilesTotal = grdMilesTotal + HourTotal
Session("grandMilesTotal") = Session("grandMilesTotal") + grdMilesTotal
Else
Dim HourTotal As Decimal
HourTotal = (DataBinder.Eval(e.Row.DataItem, "LaborHours"))
grdHoursTotal = grdHoursTotal + HourTotal
Session("grandHoursTotal") = Session("grandHoursTotal") + grdHoursTotal
End If
End If
If e.Row.RowType = DataControlRowType.Footer Then
Me.txtHrs.Text = Session("grandHourstotal")
Me.txtMiles.Text = Session("grandMilesTotal")
Session("grandMilestotal") = "0"
Session("grandHourstotal") = "0"
End If
The rate column can be two values: REGULAR and OVERTIME
I want the to totals in the footer: REGULAR 5, OVERTIME 10
The code below works in my MS DataGrid, cannot figure out how to get it to work under RadGrid
You help is much appreciated!
If e.Row.RowType = DataControlRowType.DataRow Then
Dim MilesOrHours As String
MilesOrHours = (DataBinder.Eval(e.Row.DataItem, "Rate"))
If MilesOrHours = "MI" Then
Dim HourTotal As Decimal
HourTotal = (DataBinder.Eval(e.Row.DataItem, "LaborHours"))
grdMilesTotal = grdMilesTotal + HourTotal
Session("grandMilesTotal") = Session("grandMilesTotal") + grdMilesTotal
Else
Dim HourTotal As Decimal
HourTotal = (DataBinder.Eval(e.Row.DataItem, "LaborHours"))
grdHoursTotal = grdHoursTotal + HourTotal
Session("grandHoursTotal") = Session("grandHoursTotal") + grdHoursTotal
End If
End If
If e.Row.RowType = DataControlRowType.Footer Then
Me.txtHrs.Text = Session("grandHourstotal")
Me.txtMiles.Text = Session("grandMilesTotal")
Session("grandMilestotal") = "0"
Session("grandHourstotal") = "0"
End If