
How to calculate gridview column total in Textbox in windows
how to calculate gridview column Unit total, Amount Total,TaxAmount Total and TotalAmount Total in Textboxs in windows application


Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rafnas T PRank #280 · 8.8K reputationPosted May 29, 2017, 9:44 PM EDT
decimal totalamount = 0;
for (int i = 0; i < dataGridView.Rows.Count; i++)
{
totalamount = totalamount+ Convert.ToDecimal(dataGridView.Rows[i].Cells[6].Value);
taxtotal = taxtotal + Convert.ToDecimal(dataGridView.Rows[i].Cells[7].Value);
}
amounttxt.Text = amouttotal.ToString();
TotalTaxtxt.Text = taxtotal.ToString();
totalamounttxt.Text = totalamount.ToString();
Manas MohapatraRank #182 · 13.2K reputationPosted May 29, 2017, 9:30 PM EDT
Jyoti JodhaRank #1,408 · 1.2K reputationPosted May 29, 2017, 9:34 PM EDT