title: How to set background color in devexpress XtraGrid
body: <p>I want to set the background color of devexpress winforms grid.</p>
  <p>This is the method i call.</p>
  <p>On form load..</p>
  <blockquote>
  <p>LoadCodes(); - returns a dataset which is used in gridView rowstyle  method.</p>
  <p>gridView1.RefreshData();</p>
  </blockquote>
  <pre><code>private void gridView1_RowStyle(object sender, RowStyleEventArgs e)
  {
    string code=string.Empty;
    for (int i = 0; i &lt;= ds.Tables[0].Rows.Count - 1; i++)
    {
      code = View.GetRowCellDisplayText(e.RowHandle, View.Columns[&quot;code&quot;]);
      if (code.Trim() == ds.Tables[0].Rows[i][&quot;code&quot;].ToString().Trim())
      {
          e.Appearance.BackColor = Color.LightBlue;
          e.Appearance.BackColor2 = Color.WhiteSmoke;
      }
    }
  
  }
  </code></pre>
  <p>How do i handle this or is there any other way to handle this?</p>
  <blockquote>
  <p>Issue: The code doesn't throw any error, however i don't see rows
  getting the background color automatically, after the form is loaded,
  however when i click on any row of the grid (after the form is loaded, grid data is visible), then i get to see the background color.</p>
  </blockquote>