http://xiangai.taobao.com
http://shop148612228.taobao.com

根据条件,隐藏或显示gridview中的按钮或其他控件,

  • protected void Bind() 
  • {
  •            CompInfo ci = (CompInfo)Session["coi"]; 
  •            Complinkappl cla = new Complinkappl(); 
  •            IList<ComplinkapplInfo> iclai = cla.Selsonly(" cpacompid = " + ci.Compid.ToString() + " order by cpadate desc"); 
  •            this.GridView1.DataSource = iclai; 
  •            this.GridView1.DataBind(); 
  •            foreach (GridViewRow row in GridView1.Rows) 
  •            { 
  •                LinkButton lb = row.Cells[3].FindControl("Lbtnup") as LinkButton; 
  •                Literal lt = row.Cells[3].FindControl("Lt") as Literal; 
  •                if (lt.Text != "1"
  •                { 
  •                    lb.Visible = false
  •                } 
  •                else 
  •                { 
  •                    lb.Visible = true
  •                } 
  •            } 
  •        } 
posted @ 2011-10-24 22:20  万事俱备就差个程序员  阅读(612)  评论(0编辑  收藏  举报

http://xiangai.taobao.com
http://shop148612228.taobao.com
如果您觉得对您有帮助.领个红包吧.谢谢.
支付宝红包
微信打赏 支付宝打赏