title: C# Datagridview change row color based on condition only first 1000 records
body: <p>i have a little problem with my datagridview. I am filling the Datagridview with my records from the db.</p>
  
  <p>But i want to change the back- and forecolor in a specific condition. It works fine but only with the first 1000 records and the problem is i have more than 10.000 records. Did i have a wrong event?</p>
  
  <p>I'd be grateful for a better solution.</p>
  
  <p>Best regards</p>
  
  <p>my code:</p>
  
  <pre><code>private void dataView_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
  {
      foreach(DataGridViewRow row in dataView.Rows)
      {
          int value = Convert.ToInt32(row.Cells[2].Value);
  
          if(value == 1)
          {
              row.DefaultCellStyle.BackColor = Color.Orange;
          }
          else
          {
              row.DefaultCellStyle.BackColor = Color.White;
          }
      }
  }
  </code></pre>