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

Animate UserControl in / out of split panel

3 Answers 217 Views
SplitContainer
This is a migrated thread and some comments may be shown as answers.
Shaun
Top achievements
Rank 1
Shaun asked on 02 Oct 2012, 11:04 PM

Hi,

I'm writing a demo app that has a split container with a left panel that contains a tree, which is used for navigation, and a centre panel.
When a user selects a node on the tree the corresponding User Control is then displayed on the centre panel.

What I would like to do is add some animation to the User Control so that it slides in / out of the centre panel.
Is this possible?

I got this idea from your DemoHub App, but instead of using the RadPanorama control I would like to use the SplitContaining.

I suppose the overall goal is to produce a smooth loading of the UserControl, just now it's a bit jumpy, so if it was animated the overall experience might be improved.

Cheers

Shaun


3 Answers, 1 is accepted

Sort by
0
Ivan Todorov
Telerik team
answered on 05 Oct 2012, 02:59 PM
Hello Shaun,

Thank you for contacting us.

In fact, the loading of example user controls is not related anyhow to RadPanorama and the same approach could be used. I am sending you a small sample project which demonstrates this. Note that moving the actual control using an animation will cause performing lots of layout operations and will lead to lags and flickers. Therefore, we only animate a blank white rectangle and make the control visible at the end of the animation.

I am not sure what do you mean by "jumpy" but if your only goal is to improve initial loading of user controls and animation is not obligatory, then you might just need to preload your controls/data initially. If you need any further assistance with this case, you can open a new support ticket and send us a sample project which demonstrates your scenario. This way we will be able to investigate it and provide you with a possible solution. Also, if you have any other questions, feel free to contact us.

I hope I was able to help.

Greetings,
Ivan Todorov
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Shaun
Top achievements
Rank 1
answered on 07 Oct 2012, 08:28 PM
Hi Ivan,

Thanks for getting back to me and for the demo.
So what I should do is animate a blank box and try to async the data load of my control in the back ground, then display it.
I like the idea of using some animation to grab the users attention but maybe it's not the way to go here. A better approach, as you suggested would be to improve load time.

I'll try and work out the async dataload (I'm using VS 2012)  or if you have any examples that would be great.

Cheers

Shaun.
0
Ivan Todorov
Telerik team
answered on 09 Oct 2012, 01:36 PM
Hi Shaun,

If the load time of your controls is not that much (say, not that much to cause a form freeze but still noticeable when switching between controls), then you can create and load your controls initially at application startup. This way they will be ready in the memory when you select a tree node and they will show almost instantly. However, this will slow down the startup of your application and if the load time is greater, then it might look as if the application had not started at all.

An alternate approach is to use a BackgroundWorker to load your data and display a RadWaitingBar during loading. The following help article demonstrates this.

Let me know if I can assist you further.

Greetings,
Ivan Todorov
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
SplitContainer
Asked by
Shaun
Top achievements
Rank 1
Answers by
Ivan Todorov
Telerik team
Shaun
Top achievements
Rank 1
Share this question
or