Insert a Summary row of Subtotals in ASP.NET 2.0 Gridview

Posted on 2007-08-03
Last Modified: 2013-11-05
I want to know if it is possible to create a SubTotal Summary Row withing a ASP.NET Gridview that would subtotal a count of Records based on a column value changing.  Here is an example of what the Gridview Summary would look like.   In this example I have a Gridview that displays a list of Work Orders from a Work Order Entry Application.   The query support the Gridview sorts the tickets by STATUS field.  So What I want to do is that at the end of each status type I want to subtotal the count and create like a formatted footer, say with Black Background and White forecolor.   Here is an example of what it might look like
Gridview Header --> Status   Date Opened  Desc
Rows ----------->      Open     8/1/2007         Fix CPU Error
                                 Open      8/2/2007         Undo formatting Changes
Summary Row -->   Total Work Orders with Open Status: 2   (This is the row I want inserted & formatted
                                 Hold        9/3/2007        Install new software
                                 Hold        9/4/2007        Move to HDQ
Summary Row -->   Total Work Orders with Hold Status: 2   (Again Summaries Next Grouping

I hope this gives a clear enough picture of what I am looking for.  I basiclly want to replicate a Crystal Report type functionality where the Gridview does  a summary on the GroupBY breakpoint.

Would like some assistance in what the best approach to this might be or if it is even possible in the Gridview.  I want to use the Gridview because of the sorting and Pageing features is has.  

Any help would be appreciated.
Question by:jholmes724
    LVL 14

    Accepted Solution


    Author Comment

    I will try this.  I am not sure that I can insert multiple footer rows with in one GridView, as I need a summary (footer) everytime a grouping changes, but I will give this a try and see if it works. Thank you this looks like a good article to work from.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now