if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes["onmouseover"] = "javascript:return MOver(this);"; e.Row.Attributes["onmouseout"] = "javascript:return MOut(this);"; }
function MOver(id) { var appcolor; appcolor= id.style.backgroundColor; id.style.backgroundColor='#85C0D4'; }
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { int columnNumber = 3; //Your column number where the Attribute Pass or Fail reside. if ((e.Row.Cells[columnNumber].Text.Trim()) == "Pass") { e.Row.CssClass = "pass"; } else { e.Row.CssClass = "fail"; } }
Login to post response