add Another row to GridView Footer-

N

NewTel

Hi

This code works great but it only adds the one row. I need a second one.
How?

Thanks!


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"))

ElseIf e.Row.RowType = DataControlRowType.Footer Then

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

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top