在GridView控件上,随着鼠标的移动,高亮显示鼠标所在行。主要在GridView控件的RowDataBound事件中实现,
代码如下:
  protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#00A9FF';");
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor =currentcolor");
            }
        }

相关文章:

  • 2022-12-23
  • 2021-06-23
  • 2021-12-04
  • 2021-11-12
  • 2021-07-15
  • 2022-02-19
  • 2021-10-25
猜你喜欢
  • 2022-12-23
  • 2022-01-06
  • 2022-12-23
  • 2021-11-27
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案