[RESOLVED] CollapsiblePanelExtender wont collapse
I have a repeater with a collapsible panel, when you extend the panel an ajax call is done and the div is dynamically filled with content. As the content isnt available at page load the div has zero height auomaticaly.
Code:
<asp:Repeater runat="server" ID="rptIndividualRepairsLive">
<HeaderTemplate>
<table class="grid">
<tr class="GridHeader">
<th scope="col"> </th>
<th scope="col">Job Number</th>
<th scope="col">Date received</th>
<th scope="col">Due/next appointment</th>
<th scope="col">Completed</th>
<th scope="col">Status</th>
<th scope="col">Description</th>
<th scope="col">Cancel</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><asp:LinkButton runat="server" ID="lnkExtend" Text="+" /></td>
<td><asp:literal runat="server" ID="litJobNO" /></td>
<td><asp:literal runat="server" ID="litDateReceived" /></td>
<td><asp:literal runat="server" ID="litNextApp" /></td>
<td><asp:literal runat="server" ID="litCompleted" /></td>
<td><asp:literal runat="server" ID="litStatus" /></td>
<td><asp:literal runat="server" ID="litDescription" /></td>
<td><asp:LinkButton runat="server" ID="lnkCancelJob" Text="[Cancel]" CommandName="cancel" /></td>
</tr>
<tr>
<asp:panel id="ShowHide" runat="server">
<td colspan="8">
<asp:Literal runat="server" ID="AppsList" />
</td>
</asp:panel>
</tr>
<cc1:CollapsiblePanelExtender runat="server" ID="CollapsiblePanelExtender1"
TargetControlID="ShowHide"
CollapsedSize="0"
Collapsed="True"
ExpandControlID="lnkExtend"
CollapseControlID="lnkExtend"
ImageControlID="lnkExtend"
SuppressPostBack="true"
SkinID="CollapsiblePanelDemo" autocollapse="false">
</cc1:CollapsiblePanelExtender>
</ItemTemplate>
</asp:Repeater>
NOTE: LitApplist gets changed to a div on itemdatabound
Like this it works:
<tr>
<td colspan="8">
<asp:panel id="ShowHide" runat="server">
<asp:Literal runat="server" ID="AppsList" />
</asp:panel
</td>
</tr>
But I have to assign a height on itemdatabound to the div that is formed from the literal (which is no good because I dont know how many items)
like this:
<tr>
<asp:panel id="ShowHide" runat="server">
<td colspan="8">
<asp:Literal runat="server" ID="AppsList" />
</td>
</asp:panel>
</tr>
It automatically expands to correct size but won't collapse.
Help would be great.
Re: CollapsiblePanelExtender wont collapse
Hello,
Is it possible that you can upload a "working" sample (well obviously not a working sample, I mean a not working sample, but you know what I mean :)), and we can take a look.
Gary
Re: CollapsiblePanelExtender wont collapse
Thanks Gep but I figured it out, changed my html to
<tr style="border:none;">
<td colspan="7" style="padding:0;">
<asp:panel id="ShowHide" runat="server">
<table>
<tr><td>
<asp:Literal runat="server" ID="AppsList" />
</td></tr>
</table>
</asp:panel>
</td>
</tr>
and it worked
Re: [RESOLVED] CollapsiblePanelExtender wont collapse
Hey,
Glad to hear that you got it working!!
When you are posting code into the forum, can you please remember to surround it in [code][/code] or [HIGHLIGHT=vb][/highlight] tags? It makes it a lot easier to read, and you won't get those smilies in your post :)
Gary