Click here to Skip to main content
15,902,447 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Multiple CollapsepanelExtender use on same page but extend only one CollapsiblePanelExtenderat a time..

I am using Repeater and each repeater row have a CollapsiblePanelExtenderextender.
I want a time one panel extend.


Thanks for reply in advance.
Posted
Comments
Trics071 31-Jan-13 4:47am    
just put whole repeater control in a panel use this panel as target control for your panel extender.
P_Dash 31-Jan-13 5:10am    
Provide the implemented code here, so that it'll be easy to track down the Error.

1 solution

Quote:
First CollapsiblePanelExtender Control

<ajaxtoolkit:collapsiblepanelextender id="CollapsiblePanelExtender1" runat="server" behaviorid="PanelExtender1" xmlns:ajaxtoolkit="#unknown">
CollapseControlID="pnlClick" Collapsed="true" ExpandControlID="pnlClick" TextLabelID="lblMessage"
CollapsedText="Show" ExpandedText="Hide" ImageControlID="Image1" ExpandDirection="Vertical"
TargetControlID="pnldata" ScrollContents="false">



Second CollapsiblePanelExtender Control


<ajaxtoolkit:collapsiblepanelextender id="CollapsiblePanelExtender2" runat="server" behaviorid="PanelExtender2" xmlns:ajaxtoolkit="#unknown">
CollapseControlID="pnlClick1" Collapsed="true" ExpandControlID="pnlClick1" TextLabelID="lblMessage"
CollapsedText="Show" ExpandedText="Hide" ImageControlID="Image1" ExpandDirection="Vertical"
TargetControlID="pnldata" ScrollContents="false">



Both Collapse Extender have behaviour id which help to meet requirement that is if we use more than one collapse extender on same page then at a time only one extend and other is close.By using this script

<script>


function pageLoad(sender, args) {
extenders[0] = $find("PanelExtender1");
extenders[1] = $find("PanelExtender2");


// WWB: Hook All The Extenders, If extenders[i] is null then
// the extenders is not being displayed -- i.e. not visible
for (var i = 0; i < extenders.length; i++)
if (extenders[i] != null)
extenders[i].add_expandComplete(expandHandler);
}

function expandHandler(sender, args) {
for (var i = 0; i < extenders.length; i++) {
if ((extenders[i] != null) && (extenders[i] != sender))
extenders[i]._doClose();
}
}

</script>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900