Is it possible to make math calculations between 2 columns in datagridview?

I have upgraded to VS2005 (what a difference a day makes!!!!). When I have datatable info presented to the user in a datagridview, is it possible to make math calculations (such as addition and subtraction) between 2 columns in that same datagridview while in the datagridview?  When I enter a number in one column I want it to subtract it  (after coding a button) from another column within that same datagridview.

Thanks
grouchyfdAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CDCOPCommented:
I've haven't used datasets in VS.NET yet, but im guessing something like:

Dim dg As DataGrid
Dim intValue As Integer

'dg.Item(1, 0) = dg.item(rowindex,columnindex)
intValue = CType(dg.Item(1, 0), Integer) + CType(dg.Item(1, 1), Integer)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
grouchyfdAuthor Commented:
So I convert the datatype by CType and then specify (row index, column index) for each exact record in the column I want to add togetther? If this makes the chage in the datagridview, I can push the update into the database.
0
CDCOPCommented:
I would play with it and see if it gives you the result you expect. You should be able to push the change back to the DB.
0
grouchyfdAuthor Commented:
Thank you for your help.
0
CDCOPCommented:
No problem. Thanks for points and grade.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.