Posted on: 12/17/2014 5:15:02 AM | Views : 477

I want to set background color for particular cell of gridview when that cell have any value, if it is empty then need to set another color.
How can i do that?
<asp:TemplateField HeaderText="Rejected by"> <ItemTemplate> <asp:Label ID="Rejectedby" runat="server" Text='<%#Eval("RejectedBy") %>' BackColor ='<%# (System.Convert.ToString(Eval("RejectedBy"))) != "" ? "Red" : "Gray" %>'></asp:Label> </ItemTemplate> </asp:TemplateField>

Go to the complete details ...