if (e.Row.RowType == DataControlRowType.DataRow)
{
Label newlabel= e.Row.FindControl("label1") as Label;
String mydata = newlabel.Text;
if(mydata.Equals("sometext")
{
Label newlabel2= e.Row.FindControl("label1") as Label;
newlabel2.ForeColor = System.Drawing.Color.Green;
}
else
{
Label newlabel2= e.Row.FindControl("label1") as Label;
newlabel2.ForeColor = System.Drawing.Color.Red;
}
}
No comments:
Post a Comment