4

I'm using CollapsiblePanelExtender from AjaxControlToolkit, it works fine when i click on it, but it won't expand all the way on the initial page load (expands about 90%).

I have to collapse it and expand it back manually for it to open up all the way.

I don't have the ExpandedSize property set, because the panel content is dynamic.

Any ideas?

roman m
  • 26,012
  • 31
  • 101
  • 133

3 Answers3

9

Use the following style on the target of the extender:

.collapsiblePanelContainer {
  height: 0;
  overflow: hidden;
}

The CollapsiblePanelExtender will take care of the rest of the work.

This tip is mentioned by Joe Stagner in the CollapsiblePanelExtender video.

Jim H.
  • 5,539
  • 1
  • 24
  • 23
2

If the data in the collapsible panels is fixed and there is no need to call a page postback, set the "SuppressPostBack" property of the CollapsiblePanelExtender to true. This will allow the expand action to complete more quickly and smoothly. You won't notice a delay.

a.r
  • 21
  • 1
-1

Try to set the value of "min-height" in the style of the actual panel. Otherwise you can programmatically set the height or the ExpandSize in the PreRender event

protected override void OnPreRender(EventArgs e)
{
    base.OnPreRender(e);
    // Set the size here
    myCollapsiblePanelExtender.ExpandedSize = sizeValue;
}
Nikos Steiakakis
  • 5,605
  • 7
  • 44
  • 54