Column's value color change based on condition

Shahanaakter
Posted by Shahanaakter under ASP.NET category on | Points: 40 | Views : 250
I use Placeholder control for generating dynamic table. Now i need to make color of one's column value based below on condition.But my if condition is not working. How to do it?Here is my code:

for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
strResults.Append("<tr style='color: black;'>");
strResults.Append("<td>" + ds.Tables[0].Rows[i]["Description"] + "</td>");
strResults.Append("<td>" + ds.Tables[0].Rows[i]["Target"] + "</td>");
strResults.Append("<td>" + ds.Tables[0].Rows[i]["Actual"] + "</td>");
if(ds.Tables[0].Rows[i]["Achievement"] >94% )
{
strResults.Append("<td style='color: green;'>" + ds.Tables[0].Rows[i]["Achievement"] + "</td>");
}
strResults.Append("</tr>");
}

Comments or Responses

Login to post response