title: Changing the row background color of DataGridView
body: <p>I have searched a lot and found some methods to change a rows background color in datagrid view but it does not work at all,Can you help me find my mistake?</p>
  
  <pre><code>dataGridViewResult.DataSource = morgan.GetResult().Tables[5];
          dataGridViewResult.Rows[0].Cells[1].Style.ForeColor = System.Drawing.Color.Beige;
          dataGridViewResult.Rows[0].DefaultCellStyle.ForeColor = Color.Blue;
          dataGridViewResult.Rows[7].DefaultCellStyle.ForeColor = Color.Blue;
          dataGridViewResult.Rows[40].DefaultCellStyle.ForeColor = Color.Blue;
          dataGridViewResult.Rows[11].DefaultCellStyle.ForeColor = Color.Blue;
          dataGridViewResult.Rows[19].DefaultCellStyle.ForeColor = Color.Blue;
          dataGridViewResult.Rows[28].DefaultCellStyle.ForeColor = Color.Blue;
          dataGridViewResult.Rows[35].DefaultCellStyle.ForeColor = Color.Blue;
  
          dataGridViewResult.Rows[35].DefaultCellStyle.ForeColor = Color.White;
  </code></pre>