Not sure if this helps or not, but I had something similar where i had data where based on the data i had to change the row color on the gridview, this worked well for me. This event fires just after you bind to the grid.
protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
switch(DataBinder.Eval(e.Row.DataItem, "Team").ToString().Trim())
{
case "1":
e.Row.BackColor = System.Drawing.Color.BurlyWood;
break;
case "2":
e.Row.BackColor = System.Drawing.Color.Red;
break;
}
}
}
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only