zoukankan      html  css  js  c++  java
  • ASP.NET行变色,及禁用编辑,删除按钮

        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;
            }

        }

  • 相关阅读:
    Docker _简单使用
    IDEA常见问题
    Linux安装JDK
    vitualbox网络设置链接
    MQ对比
    乐观锁和悲观所在数据库中的实现
    11.08 JS知识
    11.07知识整理
    11.06 知识整理
    本周知识整理
  • 原文地址:https://www.cnblogs.com/chenbg2001/p/1491852.html
Copyright © 2011-2022 走看看