title: C# to change the background color of a ASP:Gridview cell based on text in that same cell
body: <p>This is driving me batty. I have tried every example of this on the site and cannot get it to work. It will not fired the event</p>
  
  <ul>
  <li>I have <code>RowDataBound="SYSGrid_RowDataBound"</code> in the Gridview properties</li>
  <li><code>&lt;%@ Import Namespace="System.Drawing" %&gt;</code> on the aspx page, no .cs file for this</li>
  </ul>
  
  <p>This is the code</p>
  
  <pre><code>protected void SYSGrid_RowDataBound(object sender, GridViewRowEventArgs e)    
  {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
        if (e.Row.Cells[9].Text == "Missing")
        {
            e.Row.Cells[9].BackColor = Color.Red;
            e.Row.Cells[9].ForeColor = Color.White;
         }
      }
  }
  </code></pre>
  
  <p>I am fairly new at C# so if this is a stupid issue/question then I am willing to take harsh constructive critisism. Thanks in advance.</p>