• 操作GridView嵌套的Repeater控件


    protected void gridView_DataBound(object sender, EventArgs e)             

    {   

     int index = gv.EditIndex;

                    Repeater rpt = (Repeater)gv.Rows[index].Cells[2].FindControl("rpt");
                    RepeaterItemCollection cc = rpt.Items;

                    for (i = 0; i < cc.Count; i++)
                    {
                        for (int j = 0; j < cc[i].Controls.Count;j++)
                        {
                            HyperLink list = cc[i].Controls[j] as HyperLink;
                            if (list != null)
                            {
                                list.Visible = false;
                            }
                            else
                            {
                                TextBox lb = cc[i].Controls[j] as TextBox;
                                if (lb != null)
                                {
                                    lb.Visible = true;
                                }
                            }
                        }
                    }

    }

  • 相关阅读:
    HDU 1010 Tempter of the Bone
    HDU 4421 Bit Magic(奇葩式解法)
    HDU 2614 Beat 深搜DFS
    HDU 1495 非常可乐 BFS 搜索
    Road to Cinema
    Sea Battle
    Interview with Oleg
    Spotlights
    Substring
    Dominating Patterns
  • 原文地址:https://www.cnblogs.com/dashi/p/4034756.html
Copyright © 2020-2023  润新知