Positioning of CollapsiblePane content

Last post 11-13-2009 4:47 AM by Vince Xu - MSFT. 3 replies.

Sort Posts:

  • Positioning of CollapsiblePane content

    11-11-2009, 9:33 AM
    • Member
      32 point Member
    • craigton
    • Member since 11-23-2006, 9:24 AM
    • Posts 46

    Hi,

    Ive used the Collapsible Panel extender but the content displays to the right of the title rather than beneath it and I can't see what I'm doing wrong. 

    The code is:

    <cc1:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="server"
    TargetControlID="ContentPanel"
    ExpandControlID="TitlePanel" 
    CollapseControlID="TitlePanel" 
    Collapsed="True"
    TextLabelID="Label1" 
    ExpandedText="(Hide Details...)" 
    CollapsedText="(Show Details...)"
    ImageControlID="Image1" 
    ExpandedImage="~/images/collapse_blue.jpg" 
    CollapsedImage="~/images/expand_blue.jpg"
    SuppressPostBack="true">
    </cc1:CollapsiblePanelExtender>
    <asp:Panel ID="TitlePanel" runat="server" CssClass="collapsePanelHeader"> 
      <asp:Image ID="Image1" runat="server" ImageUrl="~/images/expand_blue.jpg"/>
    Chat Title&nbsp;&nbsp;
      <asp:Label ID="Label1" runat="server">(Show Details...)</asp:Label>
    </asp:Panel>
    <asp:Panel ID="ContentPanel" runat="server" CssClass="MainText">
    <h1>
    <br />
    Just some general chat ...
    </h1>
    </asp:Panel>

    <cc1:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="server"

    TargetControlID="ContentPanel"

    ExpandControlID="TitlePanel" 

    CollapseControlID="TitlePanel" 

    Collapsed="True"

    TextLabelID="Label1" 

    ExpandedText="(Hide Details...)" 

    CollapsedText="(Show Details...)"

    ImageControlID="Image1" 

    ExpandedImage="~/images/collapse_blue.jpg" 

    CollapsedImage="~/images/expand_blue.jpg"

    SuppressPostBack="true">

    </cc1:CollapsiblePanelExtender>

    <asp:Panel ID="TitlePanel" runat="server" CssClass="collapsePanelHeader"> 

      <asp:Image ID="Image1" runat="server" ImageUrl="~/images/expand_blue.jpg"/>

    Chat Title&nbsp;&nbsp;

      <asp:Label ID="Label1" runat="server">(Show Details...)</asp:Label>

    </asp:Panel>

    <asp:Panel ID="ContentPanel" runat="server" CssClass="MainText">

    <h1>

    <br />

    Just some general chat ...

    </h1>

    </asp:Panel>

    The CSS details are:
    .collapsePanel {
    width: 580px;
    height:0px;
    background-color:white;
    overflow:hidden;
    }

    .collapsePanelHeader
    {
    width: 580px;
    height: 20px;
    color: Yellow;
    background-color: #0000FF;
    font-weight: bold;
    float: left;
    padding: 5px;
    cursor: pointer;
    vertical-align: middle;
    }

    Thanks in advance

  • Re: Positioning of CollapsiblePane content

    11-13-2009, 3:08 AM
    Answer
    • Participant
      1,540 point Participant
    • florinlabou
    • Member since 01-11-2008, 1:03 PM
    • Posts 265

    I did remove float: left; on the header css class and the content was rendered properly, under the header.

    .collapsePanelHeader
    {
    width: 580px;
    height: 20px;
    color: Yellow;
    background-color: #0000FF;
    font-weight: bold;
    /*float: left;*/
    padding: 5px;
    cursor: pointer;
    vertical-align: middle;
    }


    I think you should use the same padding on the content as for the header (5px) otherwise your header will be wider than the content.

    Cheers,

    Florin

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: Positioning of CollapsiblePane content

    11-13-2009, 4:35 AM
    • Member
      32 point Member
    • craigton
    • Member since 11-23-2006, 9:24 AM
    • Posts 46

    Florin,

    Works a treat - thanks.

    Craigton

  • Re: Positioning of CollapsiblePane content

    11-13-2009, 4:47 AM
    Answer

    Yes, remove float:left that will cause the next panel goes to the right side.

    If you need set it with float:left to set the content location, you can set some div with float:left inside the header panel instead of setting on the header panel directly. If this is what you want, don't forget to set "float:none" for the last div inside header panel to make it back to work.


    Vince Xu
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Page 1 of 1 (4 items)