protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover","currentcolor=this.style.backgroundColor;this.style.backgroundColor='#6699ff';");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor;");
}
}
asp.net(c#) GridView实现鼠标悬停高亮显示
最新推荐文章于 2022-10-27 19:58:07 发布
本文介绍了一种使用C#为GridView控件添加鼠标悬停高亮显示的方法。通过监听RowDataBound事件,在鼠标移过表格行时改变背景颜色,并在鼠标移出时恢复原色。
709

被折叠的 条评论
为什么被折叠?



