CollapsibleButton

2 posts, 0 answers
  1. J-S
    J-S avatar
    1 posts
    Member since:
    Jun 2014

    Posted 11 Jun 2014 Link to this post

    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 !
  2. George
    Admin
    George avatar
    500 posts

    Posted 16 Jun 2014 Link to this post

    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.
     
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top