title: DefaultCellStyle.Backcolor gives me wrong color in DataGridView in C#
body: <p>I have a Datagridview and would like to change the color of the Rows like this: All the Rows that have the same value in the first Column should have the same color.<br>
  I made this to Achieve this:</p>
  
  <pre><code>    private void AlternatingRows()
      {
          foreach (DataGridViewRow row in dataGridView_daten.Rows)
          {
              if (row.Index &gt; 0)
              {
                  if (row.Cells[0].Value.ToString().Substring(0, 5) == dataGridView_daten.Rows[row.Index - 1].Cells[0].Value.ToString().Substring(0, 5))
                  {
                      row.DefaultCellStyle.BackColor = dataGridView_daten.Rows[row.Index - 1].DefaultCellStyle.BackColor;
                  }
                  else if (dataGridView_daten.Rows[row.Index - 1].DefaultCellStyle.BackColor == Color.AliceBlue)
                  {
                      row.DefaultCellStyle.BackColor = Color.FromArgb(226, 241, 254);
                  }
                  else if (dataGridView_daten.Rows[row.Index - 1].DefaultCellStyle.BackColor == Color.FromArgb(226, 241, 254))
                  {
                      row.DefaultCellStyle.BackColor = Color.AliceBlue;
                  }
              }
          }
      }
  </code></pre>
  
  <p>So basically if the value of the first cell is the same as in the row above, the color should be the same... I call this method after I bound the Data to the DataGridView...  I also tried to call it in the <code>CellFormatting</code> Event, but it did not work. 
  My Problem is that the Rows still have all the same color. When I debug it, <code>DefaultCellStyle.BackColor</code> is empty... Why does the <code>DefaultCellStyle.BackColor</code> return Empty?<br>
  Like that the <code>If</code> clause <code>else if (dataGridView_daten.Rows[row.Index -1].DefaultCellStyle.BackColor == Color.FromArgb(226, 241, 254))
  </code> will never be true... </p>