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?

[Webinar] Streamline your web hosting managementRegister Today

Jorge PaulinoConnect With a Mentor IT 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.
Jorge PaulinoIT Pro/DeveloperCommented:
colums or rows ?
leachjAuthor Commented:
All Courses

From novice to tech pro — start learning today.