Dynamic creation of collapsiblepanel

Discussion in 'ASP .Net Web Controls' started by gopijm@yahoo.com, Apr 3, 2007.

  1. Guest

    I am trying to dynamically create a Ajax toolkit CollapsiblePanel. can anybody please share a sample with me or give me some pointers
    thanks,
    GJM
    , Apr 3, 2007
    #1
    1. Advertising

  2. I take it you mean you want to create on of these controls:

    http://ajax.asp.net/ajaxtoolkit/CollapsiblePanel/CollapsiblePanel.aspx

    at runtime.

    To do this replace this in the .aspx file:

    <asp:panel ID="panelExtenderContainer" runat="server">

    <ajaxToolkit:CollapsiblePanelExtender ID="cpp" runat="Server"
    TargetControlID="ContentPanel"
    ExpandControlID="Panel"
    CollapseControlID="Panel"
    ScrollContents="False"
    Collapsed="False"
    ExpandDirection="Vertical"
    SuppressPostBack="true"
    TextLabelID="TextLabel"
    CollapsedText="Collapsed"
    ExpandedText="Opened" />

    </asp:panel>

    with this in the aspx.cs file:

    protected void Page_Load(object sender, EventArgs e)
    {
    CollapsiblePanelExtender collapsiblePanelExtender = new
    CollapsiblePanelExtender();

    collapsiblePanelExtender.TargetControlID = this.ContentPanel.ID;
    collapsiblePanelExtender.ExpandControlID = this.Panel.ID;
    collapsiblePanelExtender.CollapseControlID = this.Panel.ID;
    collapsiblePanelExtender.ScrollContents = false;
    collapsiblePanelExtender.Collapsed = false;
    collapsiblePanelExtender.ExpandDirection =
    CollapsiblePanelExpandDirection.Vertical;
    collapsiblePanelExtender.SuppressPostBack = true;
    collapsiblePanelExtender.TextLabelID = this.TextLabel.ID;
    collapsiblePanelExtender.CollapsedText = "Collapsed";
    collapsiblePanelExtender.ExpandedText = "Opended";

    this.panelExtenderContainer.Controls.Add(collapsiblePanelExtender);
    }

    HTH

    Jonathan.

    <> wrote in message
    news:...
    >I am trying to dynamically create a Ajax toolkit CollapsiblePanel. can
    >anybody please share a sample with me or give me some pointers
    > thanks,
    > GJM
    Jonathan Parker, Apr 3, 2007
    #2
    1. Advertising

  3. Guest

    Thanks Jonathan,

    I was able to do that, but when I say
    collapsiblePanelExtender.Collapsed = true; I do not get anything when
    I click on the extender. But on the other hand if
    collapsiblePanelExtender.Collapsed = false; it works perfectly.
    Also by the way I have a asp:repeater inside each of the created
    collapsiblePanelExtender.
    Any Idea why this is happening?

    Regards,
    Gopi
    , Apr 3, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. michelle
    Replies:
    0
    Views:
    409
    michelle
    Jul 4, 2003
  2. Replies:
    2
    Views:
    4,376
    Jeff B.
    Jun 11, 2007
  3. Salim
    Replies:
    0
    Views:
    541
    Salim
    Jul 30, 2007
  4. Cal Who
    Replies:
    2
    Views:
    745
    Andy O'Neill
    Mar 29, 2010
  5. Kursat

    CollapsiblePanel collapse/expand speed

    Kursat, Apr 13, 2007, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    128
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    Apr 14, 2007
Loading...

Share This Page