关于折叠面板选择了哪个面板
我有一个关于折叠面板的问题..
我有一个占位符,我动态添加多个标题面板,内容面板,可折叠面板..这是我的代码:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,您应该在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.