首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

Gridview 中 怎么实现 鼠标感应啊

2012-02-28 
Gridview 中 如何实现 鼠标感应啊?就是象普通表格那样,当鼠标划过时,对应行背景色会变化!如何实现啊?[解决

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 ' ");
}
}

热点排行