Click here to Skip to main content
15,886,258 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.
Posted

1 solution

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

Good luck,
OI
 
Share this answer
 
v2

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