设置OnRowDataBound="gvUserList_RowDataBound"

       protected void gvUserList_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            //判断是否是DataRow,以防止鼠标经过Header也有效果 
            if (e.Row.RowType == DataControlRowType.DataRow) 
            {
                e.Row.Attributes.Add("onmouseover", "e=this.style.backgroundColor; this.style.backgroundColor='#c8dafa'");
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=e");
            }
        }

相关文章:

  • 2021-11-15
  • 2021-09-11
  • 2022-12-23
  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
猜你喜欢
  • 2021-09-09
  • 2022-12-23
  • 2022-01-09
相关资源
相似解决方案