N
NewTel
Using this code only gives me one new row. I need a second for some other
calculations. How?
Protected Sub grdExcel_RowDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
' add the UnitPrice and QuantityTotal to the running total variables
SUM_AMOUNT2 += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, _
"AMOUNT"))
CANCEL_AMOUNT2 += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, _
"CANCEL_AMOUNT"))
Else
e.Row.Cells(3).Text = "Totals:"
' for the Footer, display the running totals
e.Row.Cells(4).Text = SUM_AMOUNT2.ToString("c")
e.Row.Cells(5).Text = CANCEL_AMOUNT2.ToString("c")
e.Row.Cells(6).Text = (SUM_AMOUNT2 - CANCEL_AMOUNT2).ToString("c")
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right
e.Row.Font.Bold = True
End If
calculations. How?
Protected Sub grdExcel_RowDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
' add the UnitPrice and QuantityTotal to the running total variables
SUM_AMOUNT2 += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, _
"AMOUNT"))
CANCEL_AMOUNT2 += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, _
"CANCEL_AMOUNT"))
Else
e.Row.Cells(3).Text = "Totals:"
' for the Footer, display the running totals
e.Row.Cells(4).Text = SUM_AMOUNT2.ToString("c")
e.Row.Cells(5).Text = CANCEL_AMOUNT2.ToString("c")
e.Row.Cells(6).Text = (SUM_AMOUNT2 - CANCEL_AMOUNT2).ToString("c")
e.Row.Cells(4).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(5).HorizontalAlign = HorizontalAlign.Right
e.Row.Cells(6).HorizontalAlign = HorizontalAlign.Right
e.Row.Font.Bold = True
End If