I have a conditional statement that is bound to my gridview now that will check the sql data that is passed and if it there is a certain phrase then the gridview cell will turn pink. But if the text is not there then it will turn green.
Here is the statement I have so far:
if (dataItem != null)
{
var label = dataItem["Client"].FindControl("ClientLabel") as Label;
if (label != null)
{
var item = dataItem;
var text = label.Text;
if (text == "Complete")
{
item["ClientServer"].BackColor = Color.Lime;
}
else if (text != "Complete")
{
item["ClientServer"].BackColor = Color.Salmon;
}
}
So this works and will turn the cell green or pink depending on the text, but is there a way to hide the word "complete" and still turn the cell the correct color?