We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,688 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

multiply the two columns in datagridview

Collapse | Copy Code
int s1 = Convert.ToInt16(dataGridView1.CurrentRow.Cells[3].Value);

int s2 = Convert.ToInt16(dataGridView1.CurrentRow.Cells[6].Value);

int s3 = s1 * s2;

dataGridView1.CurrentRow.Cells[38].Value = s3;

this is working fine

when i change the value lively in dataGridView1.CurrentRow.Cells[3] it multiply with the changed value

with dataGridView1.CurrentRow.Cells[6] and display the value in

dataGridView1.CurrentRow.Cells[38]

like

cell[3] cell[6] cell[38]
5 5 30

pls help

thanks in advance

3
Contributors
2
Replies
9 Hours
Discussion Span
4 Months Ago
Last Updated
19
Views
sathishk20
Newbie Poster
1 post since Feb 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

What event are you firing the code at?

Begginnerdev
Practically a Posting Shark
893 posts since Apr 2010
Reputation Points: 198
Solved Threads: 149
Skill Endorsements: 9

I m little bit confused. Are you trying to say that when you change the value of one cell in your case cell number 3 it is then being multyplied by the same number? Try to use

Convert.ToInt32 

You should mention what type of values are you converting and more important how big are they.

castajiz_2
Light Poster
32 posts since Apr 2012
Reputation Points: 3
Solved Threads: 3
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page generated in 0.0567 seconds using 2.65MB