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

当鼠标划过gridview的行时,该行的字体变色,请帮忙!解决方法

2012-02-21 
当鼠标划过gridview的行时,该行的字体变色,请帮忙!我想要实现当鼠标划过gridview的行时,该行的字体能够变

当鼠标划过gridview的行时,该行的字体变色,请帮忙!
我想要实现当鼠标划过gridview的行时,该行的字体能够变色,因为这行是超链接列,鼠标划过时还要能看到该列的下划线,鼠标移走时字体恢复以前的颜色,并且也看不到下划线了,请大家指点一下啊!

[解决办法]
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if ((e.Row.RowType == DataControlRowType.DataRow))
{
//e.Row.Cells[1].Visible = false;

//变色
e.Row.Attributes.Add( "onmouseover ", "this.style.backgroundColor= '#FFC080 ' ");
e.Row.Attributes.Add( "onmouseout ", "this.style.backgroundColor= '#ffffff ' ");
}
}
[解决办法]

热点排行