views:

95

answers:

1

Hi,

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..

A: 

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.

Stas
how can I do this, can you explain.. I mean how can I understand that when panel clicked.. I can't handle click event and can't understand which panel..
hollowman25