If you want to change the ForeColor and back ground color in the cell when the text is not in the correct format, I have this code to change the color after the text is entered
private void dataGridView1_DataError(object sender, DataGridViewDataErrorEventArgs e)
{
dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Style.ForeColor = Color.Red;
dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Style.BackColor= Color.Red;
}
hope this will solve your problem...
0 comments:
Post a Comment