关于折叠面板选择了哪个面板

发布于 2024-08-23 09:11:51 字数 1692 浏览 11 评论 0原文

我有一个关于折叠面板的问题..

我有一个占位符,我动态添加多个标题面板,内容面板,可折叠面板..这是我的代码:

    CollapsiblePanelExtender cpe = new CollapsiblePanelExtender();
    Panel pnlheader,pnlcontent;
    Label lblcontent,lblheader; Button btn;
    for (int i = 0; i < 10; i++)
    {
        ///// PANEL HEADER VE ICERIGI //////////
        pnlheader = new Panel();
        pnlheader.ID = "PanelHeader" + i;
        pnlheader.BackColor = System.Drawing.Color.Blue;
        lblheader = new Label();
        lblheader.ID = "LabelHeader" + i.ToString();
        lblheader.Text = (i + 1) + ". Header";

        pnlheader.Controls.Add(lblheader);
        /////////PANEL CONTENT VE ICERIGI //////////
        pnlcontent = new Panel();
        pnlcontent.ID = "PanelContent" + i;
        pnlcontent.BackColor = System.Drawing.Color.DarkRed;
        lblcontent = new Label();
        lblcontent.ID = "LabelContent" + i.ToString();
        lblcontent.Text = "<table><tr><td border=\"1\">DENEMEE</td></tr></table>";
        btn = new Button();
        btn.ID = "Button" + i.ToString();
        btn.Text = "Deneme.Button";
        pnlcontent.Controls.Add(lblcontent);
        pnlcontent.Controls.Add(btn);

        ///////// COLLAPSEPANEL ICERIGI///////
        cpe = new CollapsiblePanelExtender();
        cpe.ID = "CollapsePanel" + i;
        cpe.TargetControlID = "PanelContent" + i;
        cpe.ExpandControlID = "PanelHeader" + i;
        cpe.CollapseControlID = "PanelHeader" + i;
        PlaceHolder2.Controls.Add(pnlheader);
        PlaceHolder2.Controls.Add(pnlcontent);
        PlaceHolder2.Controls.Add(cpe);
    }

我如何理解展开了哪个面板..

这非常重要,请帮助..

I have a question about collapse panel..

I have a placeholder and I add more than one headerpanel, contentpanel, collapsiblepanel dynamically.. Here is my code :

    CollapsiblePanelExtender cpe = new CollapsiblePanelExtender();
    Panel pnlheader,pnlcontent;
    Label lblcontent,lblheader; Button btn;
    for (int i = 0; i < 10; i++)
    {
        ///// PANEL HEADER VE ICERIGI //////////
        pnlheader = new Panel();
        pnlheader.ID = "PanelHeader" + i;
        pnlheader.BackColor = System.Drawing.Color.Blue;
        lblheader = new Label();
        lblheader.ID = "LabelHeader" + i.ToString();
        lblheader.Text = (i + 1) + ". Header";

        pnlheader.Controls.Add(lblheader);
        /////////PANEL CONTENT VE ICERIGI //////////
        pnlcontent = new Panel();
        pnlcontent.ID = "PanelContent" + i;
        pnlcontent.BackColor = System.Drawing.Color.DarkRed;
        lblcontent = new Label();
        lblcontent.ID = "LabelContent" + i.ToString();
        lblcontent.Text = "<table><tr><td border=\"1\">DENEMEE</td></tr></table>";
        btn = new Button();
        btn.ID = "Button" + i.ToString();
        btn.Text = "Deneme.Button";
        pnlcontent.Controls.Add(lblcontent);
        pnlcontent.Controls.Add(btn);

        ///////// COLLAPSEPANEL ICERIGI///////
        cpe = new CollapsiblePanelExtender();
        cpe.ID = "CollapsePanel" + i;
        cpe.TargetControlID = "PanelContent" + i;
        cpe.ExpandControlID = "PanelHeader" + i;
        cpe.CollapseControlID = "PanelHeader" + i;
        PlaceHolder2.Controls.Add(pnlheader);
        PlaceHolder2.Controls.Add(pnlcontent);
        PlaceHolder2.Controls.Add(cpe);
    }

How can I understand which panel expanded..

it is very important, please help..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

南笙 2024-08-30 09:11:51

首先,您应该在PlaceHolder2范围内找到CollapsiblePanelExtender类型的所有控件。
然后您将能够获取每个找到的 CollapsiblePanelExtender 实例的 Collapsed 属性。

Firstly you should to find all controls of CollapsiblePanelExtender type inside the scope of PlaceHolder2.
Then you'll be able to get Collapsed property of each found CollapsiblePanelExtender instance.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文