
Do what you are doing so far in your code. The only ting you need to do is the following -
1. Add the RowDataBound event handler to your grid
2. Add the below 2 lines inside your handler-
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes["onmouseover"] = "javascript:this.style.backgroundColor = '#000000'"; //Change back color to black
e.Row.Attributes["onmouseout"] = "javascript:this.style.backgroundColor = '#ffffff'";//Change back color to white
}
protected void grid_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes["onmouseover"] = "javascript:this.style.backgroundColor = '#000000'"; //Change back color to black
e.Row.Attributes["onmouseout"] = "javascript:this.style.backgroundColor = '#ffffff'";//Change back color to white
}
}
Nitesh Luharuka
http://www.niteshluharuka.com
Amulya, if this helps please login to Mark As Answer. | Alert Moderator