We help IT Professionals succeed at work.

Load content when panel is extended

amdefacto
amdefacto used Ask the Experts™
on
I am using a updatepanel control, which contains a CollapsiblePanelExtender to expand/collapse a panel.

When the page loads for the 1st time i need the panel to be collapsed (which i am able to do). What i need is - When expand link is clicked, the panel should get expanded and should show some data in a grid. How to do this. Sample code would help.

Point is that when the page loads for the first time with collapsed panel, no call to populate data grid should be happening. Only when panel is expanded the call to populate grid needs to happen.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
StephanLead Software Engineer

Commented:
You can set the property  
Collapsed="True"
in the CollapsiblePanel

There doesn't appear to be any such event raised by this control.

However, since the control toolkit is open source you could add your own event.

Author

Commented:
can you provide some sample code for this...
StephanLead Software Engineer

Commented:
Add a BehaviorID to the CollapsiblePanelExtender .

BehaviorId="collapsibleBehavior"

Use JS Functions to hook onto the Expand and collapse events.

EX:

function pageLoad(sender,args){

$find("collapsibleBehavior").add_expandComplete( expandHandler );

}

function expandHandler( sender , args ){

<%SetData();%>;

}



Author

Commented:
need more detailed code. Sorry for that.
Found my own solution using the more efficient page wethods.

Commented:
How did you do it? I am trying to do accomplish the same thing.