protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes["onmouseover"] = "javascript:setMouseOverColor(this);"; e.Row.Attributes["onmouseout"] = "javascript:setMouseOutColor(this);"; e.Row.Attributes["onclick"] = ClientScript.GetPostBackClientHyperlink (this.GridView1, "Select$" + e.Row.RowIndex); } }
<script language="javascript" type="text/javascript"> var oldgridSelectedColor; function setMouseOverColor(element) { oldgridSelectedColor = element.style.backgroundColor; element.style.backgroundColor='yellow'; element.style.cursor='hand'; element.style.textDecoration='underline'; } function setMouseOutColor(element) { element.style.backgroundColor=oldgridSelectedColor; element.style.textDecoration='none'; } </script>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)