Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
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 30-Jan-13 23:29pm
Comments
Trics071 at 31-Jan-13 4:47am
   
just put whole repeater control in a panel use this panel as target control for your panel extender.
Gittu Dash at 31-Jan-13 5:10am
   
Provide the implemented code here, so that it'll be easy to track down the Error.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 8,438
1 OriginalGriff 6,491
2 Peter Leow 3,567
3 Zoltán Zörgő 3,326
4 Richard MacCutchan 2,397


Advertise | Privacy | Mobile
Web02 | 2.8.150123.1 | Last Updated 7 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100