HOW TO SUM THE VALUE OF GRIDVIEW COLUMN "TOTAL" IN MY TEXT BOX ON BTN CLICK EVENT IN C#.NET .
PLEASE FIND SAMPLE BELOW.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
IsraelPosted Feb 18, 2015, 6:45 AM
If this answer helps you. Please validade as "correct". This is the way to encourage people to continue to help.
Khargesh RajputPosted Feb 18, 2015, 5:17 AM
{
int sum = 0;
for (int i = 0; i < dataGridView1.Rows.Count; ++i)
{
sum += Convert.ToInt32(dataGridView1.Rows[i].Cells[4].Value);
}
txtsum.text = sum.ToString();
}