When I am trying to get the value of the present cell when I am leaving that cell, I am not able to get the value of that cell. My code is in Cell_Leave event
if (e.ColumnIndex == 5)
{
double netVal;
double.TryParse(dgvRegister.Rows[e.RowIndex].Cells[4].Value.ToString(), out netVal);
double Vat;
double.TryParse(dgvRegister.Rows[e.RowIndex].Cells[5].Value.ToString(), out Vat);
string amt = ((netVal / 100) * Vat).ToString();
}
In this case I am getting cells[4] value, when I came to cells[5].value I am getting null value. Why am I getting a null value? Please help me find a solution.
try to change the
ValuetoEditedFormattedValue