how to get multiplied value in colum3 of datagridview
I have an application where i've 3 columns in datagrid view.First column gives suppose Rate of an item, in the 2nd column user inputs quantity ,such that 3rd column shows amount(i.e. rate * quantity) when user input rate.I really need this immediately , please help me.
Ashley ArgilePosted May 20, 2009, 10:00 AM
private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{
// If current row is not null and relevant column has been modified
if (dataGridView1.CurrentRow != null && e.ColumnIndex == 1)
{
dataGridView1.CurrentRow.Cells[2].Value = decimal.Parse(dataGridView1.CurrentRow.Cells[0].Value.ToString()) * decimal.Parse(dataGridView1.CurrentRow.Cells[1].Value.ToString());
}
}
Regards
Ashley
ds psPosted May 24, 2009, 4:24 AM