title: Conditional formatting on cell value
body: <p>I've been researching conditional formatting for GridViews all over the place, but I am new to ASP.Net and having a hard time.  This is the code that I've found that makes the most sense to me:</p>
  
  <pre><code>protected void GridviewRowDataBound(object sender, GridViewRowEventArgs e)
  {
      if (e.Row.RowType == DataControlRowType.DataRow)
      {
          int CellValue = Convert.ToInt32(e.Row.Cells[2].Text);
          if (CellValue &gt;= 0)
          {
              e.Row.Cells[2].BackColor = System.Drawing.Color.Green;
          }
          if (CellValue &lt; 0)
          {
              e.Row.Cells[2].BackColor = System.Drawing.Color.Red;
          }
      }
  }
  </code></pre>
  
  <p>The GridView is incredibly simple: a header row and three columns with one row under the header with a currency amount in each column.  I just need the data cell on that second row, third column to be green if >=0 and red if &lt;0.</p>
  
  <p>I am getting an incorrect format on the int CellValue = line.</p>