GridView summary on Footer

In Asp.Net GridView, displaying summary data is a common report requirement. In usual situations we have to display the total value of all gridrows in the Footer row. We can include this footer row in GridView in a simple way.

gridview summary on footer


In this article I have used Microsoft's Pubs database for sample data. You can download it free from the following link.


Calculate Total and display in Gridview

In the following program, retrieving the data from the STOR table from PUBS database and display the Total Quantity at the footer row. In order to get the summary reports on footer row, we have to include FooterTemplate in the GridView.

gridview total on footer

Add gridview totals in the footer

In the code behind, at the RowDataBound event fetching the quantity from each row and calculating the total quantity.

gridview footer

After calculating the total quantity, the program assign the value to the lblTotalqty at the gridview Footer.


C# Source Code

VB.Net Source Code (C) 2021    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.
SiteMap  | Terms  | About