Click here to Skip to main content
12,621,744 members (34,666 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as



How to add up value of a particular column in datagridview

, 3 Oct 2012 CPOL
I am not sure if this is the right answer, tho you can use two controls to achieve what you want.Use a Repeater which gets the unique days and then put the GridView inside that repeater.Use the footer of the GridView to show the Sum of Income column. <!-- Get unique...


Members may post updates or alternatives to this current article in order to show different approaches or add new features.

3 Oct 2012
Ese ochuko
2 alternatives  
Hi friends i have a datagridview that retreive information from a db. My db has a table that has a column called income, now what i want is a way to sum up the value of the income column at the end of everyday to get the total income for that day. Please i need help on this thanks in advance
3 Oct 2012
Samsani.v.s.Durga Prasad
put a textbox in the footer control then find the textbox control usingtextbox txtSum= gridview1.FooterRow.FindControl("txtTotal") as TextBoxThen bind the total value to txtSum like how you will bind data to gridtxtSum= "select sum(income) from incometable"


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Manoj De Mel
Australia Australia
No Biography provided

| | Privacy | Terms of Use | Mobile
Web02 | 2.8.161128.1 | Last Updated 3 Oct 2012
Article Copyright 2012 by Manoj De Mel
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid