Click here to Skip to main content
14,775,067 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to calculate sum of Amount in grid view.
In Gridview I am showing following fields:
PO_NO, Item, Rate ,Qty, Disc, Amt.
1 1 100 1 0 100
2 2 500 2 1000

I want sum of Amt column.

1 solution

You just need to loop throught the rows of the gridview
For Each row As DataGridViewRow In yourDataGridViewName.Rows
    totalAmount = totalAmount + row.Cells("Amt").Value
    'Do Something

Good luck,

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