Unlike Solution 3, I don't like to use cell numbers such as "cell[3]" because if I move, add, or delete a column, it will highlight the wrong row using the wrong field. Nor do I like depending on the cell's .Text property because maybe I've got a button or some other content or formatting in there. Solution 3 works if you're certain not to move the column around at all and you're using a simple bound field.
I use a template field, place a label control in the template and then Find that control within the row and set it's attributes. This is like Solution 4, but I don't like to put code in the markup if I can help it.
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
lblMyLabel = e.Row.FindControl("lblMyLabel");
switch ((System.Data.DataRowView)e.Row.DataItem)
{
case "active" : lblMyLabel.ForeColor = System.Drawing.Color.Green; break;
case "not active" : lblMyLabel.ForeColor= System.Drawing.Color.Red; break;
case "process" : lblMyLabel.ForeColor= System.Drawing.Color.Blue; break;
}
}
}