AlternatingRowStyle-CssClass="alt"
.Grid .alt { background:#DEEDF5; }
void productsGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { int ID= Convert.ToInt32(DataBinder.Eval(e.Row.DataItem,"ID")); string strCategory= Convert.ToInt32(DataBinder.Eval(e.Row.DataItem,"Category")); if (ID== 1 && strCategory == "sales") e.Row.BackColor = Color.Yellow; else if(ID== 2 && strCategory == "production") e.Row.BackColor = Color.Gray; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)