Solved

ASP.net GridView with totals at the bottom

Posted on 2016-10-28
2
23 Views
Last Modified: 2016-10-28
Hi

I know that this is probably not possible but is there any way to show the totals of all numeric columns in a bound GridView in ASP.net?

Thanks
0
Comment
Question by:murbro
2 Comments
 
LVL 49

Accepted Solution

by:
Ryan Chong earned 500 total points
ID: 41863494
yes, it's possible. you can do it in the RowDataBound event of your gridview and look for row type equals to footer, like:

protected void yourGridView_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.Footer)
            {
                  e.Row.Cells[1].Text = "yourCalculated Total...";
             }
     }

Open in new window

further reading:

GridView Examples for ASP.NET 2.0: Displaying Summary Data in the Footer
https://msdn.microsoft.com/en-us/library/ms972833.aspx
1
 

Author Closing Comment

by:murbro
ID: 41863622
Thanks very much
0

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

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

746 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

13 Experts available now in Live!

Get 1:1 Help Now