Row coloring on mouseover
-
I'm trying to use this code to change the color of a row when I put the mouse on it. protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='blue'"); e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='white'"); } } Do I need to be using hyperlink columns for all my data ? Or should it work for bound columns as well ? Thanks
-
I'm trying to use this code to change the color of a row when I put the mouse on it. protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='blue'"); e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='white'"); } } Do I need to be using hyperlink columns for all my data ? Or should it work for bound columns as well ? Thanks
No need for HYperlink. It will work fine.
Regards, Satips.