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.
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.
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.
After calculating the total quantity, the program assign the value to the lblTotalqty at the gridview Footer.
C# Source Code
VB.Net Source Code
- ASP.NET Simple GridView
- Sorting , Paging and AutoGenerateColumns
- ASP.NET GridView Editing
- ASP.NET GridView Delete
- DropDownList in GridView
- Create Gridview at runtime
- Gridview - Add, Edit and delete
- Gridview export to Excel
- Gridview export to CSV
- Subtotal row in Gridview
- SubTotal and GrandTotal in GridView
- Create Gridview without database
- GridView from Stored Procedure
- How to create Gridview Popup Form
- How to create a Blank row in gridview
- Nested GridView in ASP.NET
- Freeze Gridview Header row, Scroll in GridView
- Auto Generate Row Number in GridView
- Image between GridView rows
- How to select a row in gridview
- Checkbox in ASP.NET GridView Control