protected void gvMoreSize_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {

for (int j = 0; j < this.gvMoreSize.Rows.Count + 1; j++)
            {
                //首先判断是否是数据行
                if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    //当鼠标停留时更改背景色
                    e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.color='#116a79';this.style.backgroundColor='#cef97b'");
                    //当鼠标移开时还原背景色
                    e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c;this.style.color='#3a6381'");
                    e.Row.Attributes["style"] = "Cursor:pointer";
                }
            }

}

相关文章:

  • 2022-12-23
  • 2021-07-04
  • 2021-09-29
  • 2022-02-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-05
  • 2022-12-23
相关资源
相似解决方案