博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

gridview中实现选种行变色

Posted on 2007-08-21 16:17  小飞龙(Jack)  阅读(284)  评论(0编辑  收藏  举报
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'");

        }   
    }