gridveiw怎么实现鼠标滑过的时候改变该行的背景颜色

2025-03-06 22:43:07
推荐回答(1个)
回答1:

ASPX页面: 代码: protected void grid1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes["onmouseover"] = "this.backgroundColor='#F00'"; e.Row.Attributes["onmouseout"] = "this.backgroundColor='#FFF'"; } }