I have found a code behind snippet that looks like it will work for what I need. I need to have a result in a query GridView to turn red if a number is over a threshold (i.e. if result is greater than 2 make the background red). My issue is the code I found uses text for comparsion and I need to compare a number. What can I use instead of "Text" in "e.Row.Cells[3].Text"? I am very new to C# and have checked my books and cannot find anything.
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.Cells[3].Text >= 2)
{
e.Row.Cells[3].Style.Add("background-color", "red");
}
}
}
...
Go to the complete details ...