Link to home
Start Free TrialLog in
Avatar of lincstech
lincstech

asked on

Calculating column datagridview

Hello,

How do you calculate an entire column in a datagridview in vb.net ?
ASKER CERTIFIED SOLUTION
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
hi..try this way..
 
decimal a=0, b=0, c=0;
 
for (int i = 0; i < (gridview1.Rows.Count); i++)  
           {
               a = Convert.ToDecimal(gridview1.Rows.Cells["Column Index"].Text.ToString());
               c = c + a; //storing total qty into variable

}