当前位置: 代码迷 >> ASP.NET >> Gridview 中 怎么实现 鼠标感应啊
  详细解决方案

Gridview 中 怎么实现 鼠标感应啊

热度:693   发布时间:2013-02-25 00:00:00.0
Gridview 中 如何实现 鼠标感应啊?
就是象普通表格那样,当鼠标划过时,对应行背景色会变化!

如何实现啊?

------解决方案--------------------------------------------------------
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add( "onmouseover ", "this.style.backgroundColor= '#E6F5FA ' ");
e.Row.Attributes.Add( "onmouseout ", "this.style.backgroundColor= '#FFFFFF ' ");
}
}
  相关解决方案