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

What event are you firing the code at?

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.