陈宝刚---享受生活,追逐梦想!
理想是心中的火焰,有追求的人才是幸福的人!

    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='#8AC8F3'");
            //当鼠标移开时还原背景色
            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
            //编辑按钮禁用
            LinkButton EditBt = (LinkButton)(e.Row.Cells[16].FindControl("LinkButton1"));
            EditBt.Enabled = false;
            //删除按钮禁用
            LinkButton DeletBt = (LinkButton)(e.Row.Cells[16].FindControl("LinkButton2"));
            DeletBt.Enabled = false;
        }

    }

posted on 2009-05-29 21:42  追梦人RUBY  阅读(246)  评论(0编辑  收藏  举报