title: How to change color in TemplateField using Eval
body: <p>I have a Gridview contain many TemplateField.<br/>
  I want make every <code>&lt;td&gt;</code> in my html source equal the color saved in my database <br/>
  I try code Located below but not working it's  give me a <code>&lt;span&gt;</code> tag inside <code>&lt;td&gt;</code> with my color but <strong>But do not appear on the browser</strong></p>
  
  <pre><code>&lt;asp:TemplateField HeaderText="BackGround Color"&gt;
       &lt;ItemTemplate&gt;
             &lt;asp:Label  ID="lblBackColor" runat="server" 
                     BackColor='&lt;%# ConvertFromHexToColor( Eval("BackColor").ToString()) %&gt;'&gt;
              &lt;/asp:Label&gt;
             &lt;itemstyle width="20%" horizontalalign="Center" /&gt;
       &lt;/ItemTemplate&gt;    
  &lt;/asp:TemplateField&gt;
  </code></pre>
  
  <p>C# code working </p>
  
  <pre><code>public  Color ConvertFromHexToColor(string hex)
  {
      string colorcode = hex;
      int argb = Int32.Parse(colorcode.Replace("#", ""), NumberStyles.HexNumber);
      Color clr = Color.FromArgb(argb);
      return clr;
  }
  </code></pre>
  
  <p>And this is the source  html and css code in my browser </p>
  
  <pre><code>            &lt;td&gt;
                  &lt;span id="BodyZone__ThemesGrid_lblForeColor_0"  style="background-color: #FFFFFF;"&gt;&lt;/span&gt;
                  &lt;itemstyle width="20%" horizontalalign="Center"&gt;
                      &lt;/itemstyle&gt;
              &lt;/td&gt;
  </code></pre>
  
  <p>CSS</p>
  
  <pre><code>table.activity_datatable td {
  padding: 8px 15px;
  color: #6c6c6c;
  vertical-align: middle;
  -webkit-transition: all 0.2s;
  }
  </code></pre>