Hi, I have an ItemTemplate that gets a numeric value from <%# Bind("Retard") %>. If the value is negative I want the background to be Red, is positive I want the background to be Green. The data source is a DataTable, I dont want to loop the DataTable and write the HTML, I would like to know if I can do it inside the GridView, is it possible?
<asp:TemplateField HeaderText="Retard" SortExpression="Retard"><ItemTemplate><asp:Label ID="Label1" runat="server" Text='<%# Bind("Retard") %>'></asp:Label></ItemTemplate></asp:TemplateField>Example, the background color of the cells should be red or green:
Thanks