How do I total columns of a gridview for all pages with paging turned on?

I there a way to total the colums of a gridview for all pages, not just the displayed one?  I can total the column ok, but it will only total the visible page.  I use the datarowbound event of the gridview.  Any suggestions?


Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs)

        Dim AttendeeTotal As Integer

        If e.Row.RowType = DataControlRowType.DataRow Then
            ' add the Attendees to the running total variables
            AttendeeTotal += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "Attendees"))
        ElseIf e.Row.RowType = DataControlRowType.Footer Then
            e.Row.Cells(0).Text = "Total of Attendees:"
            ' for the Footer, display the running totals
            e.Row.Cells(1).Text = AttendeeTotal.ToString("d")
            e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Right
            e.Row.Font.Bold = True
        End If
    End Sub
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jorge PaulinoIT Pro/DeveloperCommented:
colums or rows ?
leachjAuthor Commented:
Jorge PaulinoIT Pro/DeveloperCommented:
You have to remove the paging, bind the gridview (GridView1.DataBind()) and count the columns. Then turn on the gridview and bind it. The user will not see this.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.