Hi
I have a question regarding the datagridview cellFormatting event in C#,
if (e.ColumnIndex >= 0)
{
if (this.dgvSubContractor.Columns[e.ColumnIndex].Name == "TelNo")
{
if (e.Value != null)
{
this.dgvSubContractor[3, row].Value = c.CheckingValue(e.Value.ToString()).ToString();
}
}
return;
}
I wrote the below code to format a 10 digit number to (456) 123-7890
But when I add a new row the previous value of the tel no will display in the newly added row,
How can I avoid this.