This is a migrated thread and some comments may be shown as answers.

RadExpander & Splitter resize problems

1 Answer 337 Views
Expander
This is a migrated thread and some comments may be shown as answers.
Justin
Top achievements
Rank 1
Justin asked on 24 Jun 2011, 12:55 AM
Hello there,

We have a simple requirement to have four panels docked to each side of a window (left, top, right, bottom) and have a splitter to be able to resize those user-controls.

One of our developers has come across an issue where once we resize the control and try and collapse the RadExpander, the effect is a fold in from the middle of the screen rather than the original effect.

From looking at it through SilverlightSpy, it seems that the RadExpander only resizes the container control after the splitter resizes it instead of the RadExpander when initially loaded.

I've created an example project for your reference, please excuse the colours/code... it's a very quick repro.

http://www.mediafire.com/?nmc48xordkhzraz

Telerik Version: 2011.1.419.1040 (we can't move to a new version yet!)

Try:
  1. Running the project and collapsing each panel
  2. Resize one of the panels and collapse/expand... notice the effect differs.
  3. Open SilverlightSpy and compare both instances of the RadExpander at expanded state and collapsed state after step two. You'll see that one has resized the container (the one that you resized) the other has resized the RadExpander (the one you left alone) in step 2.

Any suggestions on mitigating this would be greatly appreciated.

Thanks,

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 29 Jun 2011, 01:46 PM
Hi Justin,

Thank you for sending the sample project. The animation that is executed after resizing the RadExpander with the GridSplitter is actually the default animation of the control and it is the same animation that is executed before the resizing operation.

The different visualization comes from the fact that after you resize the control with the GridSplitter, an explicit size is set to the Grid.Column hosting the RadExpander controls. This means that you can observe the same behavior if you place the RadExpander control in a Grid.Column with an explicit Width.

By default the RadExpander Content is Stretched and when the control is placed in an Grid.Column with Auto Width, then when the RadExpander animation collapses the content, it basically reduces its size and therefore the Column's size is reduced as well. Since both operations are simultaneous the animation seems as though the Content is pushed back to the RadExpander's Header. But if you place the RadExpander inside a Column with explicit width, then the collapse animation will reduce the Content's size, but not the Column's size thus causing a different visualization of the animation.

You can, however, define the RadExpander so that its collapse animation will always push the content to the header. If the RadExpander.ExpandDirection is Left, then you can set the HorizontalContentAlignment to Right. And if the RadExpander.ExpandDirection is Right, then you can set the HorizontalContentAlignment to Left. This way the collapse animation visualization won't depend on the size of the Grid.Column hosting the RadExpander. I modified the sample project to illustrate this suggestion. Give it a try and let us know if it works for you.

Best wishes,
Tina Stancheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Expander
Asked by
Justin
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or