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

CollapsibleButton

1 Answer 17 Views
This is a migrated thread and some comments may be shown as answers.
J-S
Top achievements
Rank 1
J-S asked on 11 Jun 2014, 06:31 PM
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

Sort by
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:
  1. 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;
    }
  2. 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.
 
Asked by
J-S
Top achievements
Rank 1
Answers by
George
Telerik team
Share this question
or