Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am creating windows application using c# 2010 – in my application using I am data grid view,
I am create three columns in my data grid view

Ex
Slno mts cms

I am enter values differently
Example: First row I am enter value for ‘mts’ and second row I am enter value for ‘cms’
This way to I am enter values and many more rows.
I want how to sum the total values shown on text box

Give me any one ideas.

What I have tried:

How to get sum values for data grid view enters values in different rows and different columns
Posted
Updated 8-Jul-16 23:38pm
v2

1 solution

Iterate through each row adding the values in each column to a corresponding total. When you have processed all rows then you can display the totals wherever you want.
 
Share this answer
 
Comments
Boopalslm 9-Jul-16 5:46am    
Thanks for your idea, but my data grid view columns I creating repeated columns
Here I am set data grid view allowed only 5 rows after complete enter 5 rows same columns are repeated again 5 rows.
Here how to get sum.
Richard MacCutchan 9-Jul-16 6:12am    
What do you mean how? You add up the individual cells that you want to combine.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900