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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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;
               }
           }
       }

  

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

上一篇:dpi dip 分辨率 屏幕尺寸 px density 关系及换算


下一篇:Walkthrough: Capturing the GUID Values of Records Selected in a Grid (CRM 2011 Edition)