`
maybe723
  • 浏览: 45010 次
  • 来自: ...
最近访客 更多访客>>
社区版块
存档分类
最新评论

gridview中实现选种行变色

    博客分类:
  • .net
阅读更多

对gridview增加RowDataBound事件 :

  protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='Gray'");
            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='white'");

        }   
    }

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics