Saturday, March 24, 2012

Exapanding the CollapsiblePanelExtender in code

Hello,

I have the following collapsiblePanelExtender declared on my page. So initially it is collapsed...

<ajaxToolKit:CollapsiblePanelExtenderID="CollapsiblePanelExtenderCasing"runat="Server"TargetControlID="PanelCasingViewDetails"ExpandControlID="ImageExpand"

CollapseControlID="ImageExpand"Collapsed="True"ExpandedImage="~/images/collapse.gif"CollapsedImage="~/images/expand.gif"ImageControlID="ImageExpand"SuppressPostBack="true"/>

and I'm trying to cause it to expand in code using..

Me.CollapsiblePanelExtenderCasing.Collapsed =False

...but the panel does not expand after this line executes. Any ideas?

You need to set the clientstate to false before calling the collapsed property.

Me.CollapsiblePanelExtenderCasing.ClientState = False
Me.CollapsiblePanelExtenderCasing.Collapsed = False

I ran into the same issue when I was trying to programatically expand and collapse the panels. Just make sure you properly update the CollapsedImage and ExpandedImage as I am not positive on if those will update.

Let me know if that helps

JoeWeb


That was it. Thanks.

No comments:

Post a Comment