summary footer on paged gridview?

T

tfsmag

I know how to do summary footers in a gridview... but when i try it in
a paged gridview it puts a footer on every page of just the items on
that page. Any suggestions on how to get it to work so that it only
posts on the last page of the gridview with the totals for the entire
dataset?

here is how i'm getting the footer summary now

Protected Sub TotIncurGrid_RowDataBound(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.GridViewRowEventArgs) Handles
TotIncurGrid.RowDataBound

If e.Row.RowType = DataControlRowType.DataRow Then
total_paid +=
Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "total_paid"))
outstanding_reserve +=
Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem,
"outstanding_reserve"))
total_recovered +=
Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "total_recovered"))
total_incurred +=
Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "total_incurred"))
claim_count +=
Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "claim_count"))
cost_per_claim +=
Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "cost_per_claim"))
iDivider += 1
ElseIf e.Row.RowType = DataControlRowType.Footer Then
e.Row.Cells(0).Text = "<strong>Totals:</strong>"
' for the Footer, display the running totals
e.Row.Cells(1).Text = total_paid.ToString("c")
e.Row.Cells(2).Text = outstanding_reserve.ToString("c")
e.Row.Cells(3).Text = total_recovered.ToString("c")
e.Row.Cells(4).Text = total_incurred.ToString("c")
e.Row.Cells(5).Text = claim_count.ToString()
e.Row.Cells(6).Text = Convert.ToString((cost_per_claim /
iDivider).ToString("c"))
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Right
e.Row.Font.Bold = True
End If
End Sub

any help is greatly appreciated!
 

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,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top