Hi, Is it possible to not expand the panel when I create it at runtime ? If I set the property "isExpanded" to false after adding to my controls (me.controls.add(collapsiblepanel)) I see the panel closing when the form is loading....
Thanks !
1 Answer, 1 is accepted
0
George
Telerik team
answered on 16 Jun 2014, 04:53 PM
Hello,
Thank you for writing.
Currently, there are two ways to do this:
In the constructor of the form set the IsExpanded property to true as you first load the ElementTree:
RadCollapsiblePanel collapsiblePanel;
public Form1()
{
InitializeComponent();
collapsiblePanel = new RadCollapsiblePanel();
this.Controls.Add(collapsiblePanel);
collapsiblePanel.LoadElementTree();
collapsiblePanel.IsExpanded = false;
}
The second way to do this is when the form loads to disable the animations, collapse the panel and re-enable the animation:
RadCollapsiblePanel collapsiblePanel;
public Form1()
{
InitializeComponent();
collapsiblePanel = new RadCollapsiblePanel();
this.Controls.Add(collapsiblePanel);
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
this.collapsiblePanel.EnableAnimation = false;
this.collapsiblePanel.Collapse();
this.collapsiblePanel.EnableAnimation = true;
}
Do not hesitate to write back, should you have further questions.
Regards,
George
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.