private void dataGridView1_CellEndEdit_1(object sender, DataGridViewCellEventArgs e)
{
double cell1 = 0;
double cell2 = 0;
if (e.ColumnIndex == 0 || e.ColumnIndex == 2)
{
if (!object.ReferenceEquals(dataGridView1.CurrentRow.Cells[0].Value, DBNull.Value))
{
cell1 = Convert.ToSingle(dataGridView1.CurrentRow.Cells[0].Value);
}
if (!object.ReferenceEquals(dataGridView1.CurrentRow.Cells[2].Value, DBNull.Value))
{
cell2 = Convert.ToSingle(dataGridView1.CurrentRow.Cells[2].Value);
}
if (cell1.ToString() != "" && cell2.ToString() != "")
{
dataGridView1.CurrentRow.Cells[6].Value = cell1 * cell2;
}
}
}