title: Change color in dataGridView cell
body: <p>I want to change the ForeColor 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 - is this the right way?  </p>
  
  <pre><code>private void dataGridView1_DataError(object sender, DataGridViewDataErrorEventArgs e)
  {
       dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Style.ForeColor = Color.Red;
  }
  </code></pre>
  
  <p>And how can I change it back after the user enters text in the correct format?</p>