Click here to Skip to main content
15,897,032 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can I calculte the sum of integer and float values stored in a dataGridView column on a datagrid view columns click and store the show in a textbox ?
c#
Posted
Updated 5-Nov-12 21:06pm
v2

Make sumcolumn a global variable

C#
sumcolumn =0;

for (int i = 0; i < (dataGridView2.Rows.Count - 1); i++)

{

sumcolumn =sumcolumn + Convert.ToInt16(dataGridView2.Rows[i].Cells["columnname"].Value);


}
textbox1.text= Convert.tostring(sumcolumn)
 
Share this answer
 
HI
Please check these links:
link 1[^]
link 2[^]
link 3[^]







Vote if it helps...
 
Share this answer
 

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