日期:2014-05-19  浏览次数:20454 次

GridView的特殊效果
如何实现鼠标在GridView的哪一行上,哪一行就高亮显示(背景色改变)?

------解决方案--------------------
参考
http://www.cnblogs.com/webabcd/archive/2007/02/04/639830.html
------解决方案--------------------
Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Item.Attributes.Add( "onmouseover ", "this.style.backgroundColor= '#D7EEB3 ' ") '鼠标移动时得颜色
e.Item.Attributes.Add( "onmouseout ", "this.style.backgroundColor= '#ffffff ' ") '鼠标离开后的颜色
end if
End Sub