fill color from database
<p>I have color table in my database. When page loads color id and color name and color should displayed in GridView. </p>

<p>datafield="color_Id" contains hex color value. I want to use that hex color code into the back color of the gridview table. </p>

<p>My code is:</p>

<pre><code>&lt;asp:GridView id="GridView1" runat="server" BorderColor="Black" OnSelectedIndexChanged="GridView1_SelectedIndexChanged"&gt;
                    &lt;columns&gt;
                        &lt;asp:CommandField ShowSelectButton="True"&gt;&lt;/asp:CommandField&gt;
                        &lt;asp:BoundField DataField="color_Id" HeaderText="Color Id"&gt;&lt;/asp:BoundField&gt;
                        &lt;asp:BoundField DataField="color" HeaderText="Color Name"&gt;&lt;/asp:BoundField&gt;
                        &lt;asp:TemplateField HeaderText="Color"&gt;
                            &lt;ItemTemplate&gt;
                                &lt;asp:Label ID="lblColor" BackColor='&lt;%# Eval("color_Id") %&gt;' runat="server"&gt;&lt;/asp:Label&gt;
                            &lt;/ItemTemplate&gt;
                        &lt;/asp:TemplateField&gt;

&lt;/columns&gt;
                &lt;/asp:GridView&gt;
</code></pre>
