Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiplying 2 columns in datagridview

Status
Not open for further replies.

allanmc10

Programmer
Feb 23, 2006
39
GB
i am trying to multiply to decimals in a datagridveiw to give me a total.

Code

dgSRLevel.Item(9, dgSRLevel.CurrentRow.Index()) =(dgSRLevel.Item(6, dgSRLevel.CurrentRow.Index()) * dgSRLevel.Item(8, dgSRLevel.CurrentRow.Index()))

i have tried numerous ways of converting to decimal but keeps saying csan not convert to decimal

anyony help
 
In sead of doing this, you should look into adding a column to the datatable behind the datagridview, and setting the column's Expression property to perform the calculation.



I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day! Ye has a choice: talk like a pira
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top