Link to home
Start Free TrialLog in
Avatar of Jassimi
JassimiFlag for Bahrain

asked on

Find Total amount of one column in Datagrid and put it in textbox

hi..
I have a datagrid(DataGridView1) that have some columns from dataset,
the last column is(price). I want to find the total amount of this column(price) and put it in the textbox.
how can I fix that
Thanks
ASKER CERTIFIED SOLUTION
Avatar of JunnickYso
JunnickYso
Flag of Philippines 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
Avatar of Jassimi

ASKER

where should I write this code?
is it in same textbox?
Avatar of Jassimi

ASKER

not this what I want
I want to calculate the total amount of the price column which is in datagrid in textbox
Jassimi:

where should I write this code?
is it in same textbox?

-where should I write this code?
I assume you a have a button that would trigger the calculation event. And the code provided you should be in that code block.

-is it in same textbox?
Probably yes? That was just an example if your using other TextBox name then set to the respective textbox!

maybe you can submit you partial code and feed me more of what your trying to do: :-)

Avatar of Jassimi

ASKER

sorry for late,
I don't have a button to calculate the event,
I put a textbox under the datagridview to calculate the total amount of the price column,

when I tried your code, it doesn't do that, it just calculate the rows of the datagrid
Avatar of Jassimi

ASKER

ok..
its working now but by temptable
not by original database source

thanks