Friday, June 12, 2009

Change Color Of Gridview On Mouse-Over

protected void gridRole_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes["onmouseover"] = "this.style.cursor='hand';this.style.textDecoration='underline';this.style.background='#E2DED6';";

e.Row.Attributes["onmouseout"] = "this.style.textDecoration='none';this.style.background='none';";
}
}

No comments: