Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ASP.NET GridView 2.0 DynamicBackColor ?
Message
 
To
07/04/2006 14:18:33
Keith Payne
Technical Marketing Solutions
Florida, United States
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01111476
Message ID:
01111507
Views:
13
This message has been marked as the solution to the initial question of the thread.
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
Map
View

Click here to load this message in the networking platform