RadCollapsiblePanel isExpandad

5 posts, 0 answers
  1. Arif
    Arif avatar
    1 posts
    Member since:
    May 2014

    Posted 15 May 2014 Link to this post



    Hello Telerik Team,


    I have a question about the radcollapsiblepanel. When

    I create a new collapsiblepanel programmatically the isExpanded property is not

    working.

    01.public partial class Form1 : Form
    02.  {
    03.      public Form1()
    04.      {
    05.          InitializeComponent();
    06.          RadCollapsiblePanel pn = new RadCollapsiblePanel();
    07.          pn.Dock = DockStyle.Left;
    08.          pn.ExpandDirection = RadDirection.Right;
    09. 
    10.          pn.IsExpanded = false;    <------ Is not working
    11. 
    12.          this.Controls.Add(pn);          
    13.         
    14.      }
    15.  }



     



    Is there something that I’m missing?





    Kindest
    regards,

    Arif

  2. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 16 May 2014 Link to this post

    Hi Arif,

    Thank you for writing.

    When you are initializing the control this way in the forms constructor it is still not loaded and this is why it is not collapsed. In this case you can either call the LoadElementTree method before setting the IsExpanded property or just set this property in the form's Load event:
    RadCollapsiblePanel pn = new RadCollapsiblePanel();
     
    public Form1()
    {
        InitializeComponent();
     
        pn.Dock = DockStyle.Left;
        pn.ExpandDirection = RadDirection.Right;
     
        pn.LoadElementTree();
        pn.IsExpanded = false;
     
        this.Controls.Add(pn);  
    }
     
    private void Form1_Load(object sender, EventArgs e)
    {
        pn.IsExpanded = false;
    }

    Also I have noticed that you have posted identical post and we have deleted it in order to avoid such duplicate posts in our forum.

    I hope this helps. Should you have any other questions do not hesitate to ask.

    Regards,
    Dimitar
    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
  4. Abbas
    Abbas avatar
    13 posts
    Member since:
    Oct 2012

    Posted 07 Mar 2015 Link to this post

    Hello Telerik Team,

    I would like to RadCollapsible panel be collapsed when the form is loaded and showing for the first time.
    IsExpanded property just collapsed the already spread RadCollapsible control on the form.

    Regards,
    Abbas


  5. Abbas
    Abbas avatar
    13 posts
    Member since:
    Oct 2012

    Posted 11 Mar 2015 Link to this post

    Up.
  6. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 11 Mar 2015 Link to this post

    Hello Abbas,

    Thank you for writing.

    The animations slow down the collapse process and this is why the panel is still visible when the form is shown. You can disable the animation when the form is loaded and the panel will be collapsed when the form is started:
    RadCollapsiblePanel pn = new RadCollapsiblePanel();
      
    public RadForm1()
    {
        InitializeComponent();
      
        pn.Dock = DockStyle.Left;
        pn.ExpandDirection = RadDirection.Right;
        pn.EnableAnimation = false;
        pn.LoadElementTree();
        pn.IsExpanded = false;
         
        this.Controls.Add(pn);
        pn.EnableAnimation = true;
    }

    Please let me know if there is something else I can help you with. 
     
    Regards,
    Dimitar
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for WinForms is Visual Studio 2017 Ready