Rad Panel expanded property Q1 2008

4 posts, 0 answers
  1. Andrew
    Andrew avatar
    7 posts
    Member since:
    May 2008

    Posted 11 Jul 2008 Link to this post

    Hello,
    I have recently purchased the latest winforms (Q1 2008) and am trying to programatically set the expanded property of the panel bar control.

    I noticed a forum thread that suggested there was now a property called GroupExpanded, which i cannot see.

    The fix for this involved removing any previous 2006 demo version and reibnstalling the q1 2007 version.

    However I only see the Q1 2008 version in add remove programs so cannot do this ...

    Any ideas?
  2. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 14 Jul 2008 Link to this post

    Hello Andrew,

    Thank you for writing.

    If you want to expand RadPanelBar item element in run-time you could use the code-block below:
     
    ((RadPanelBarGroupElement)this.radPanelBar1.Items[1]).Expanded = true

    I hope this helps. If you have additional questions, do not hesitate to contact me again.
     

    Kind regards,
    Martin Vasilev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Andrew
    Andrew avatar
    7 posts
    Member since:
    May 2008

    Posted 15 Jul 2008 Link to this post

    Hi,

    I'm actually trying to PREVENT the groups from being expanded by default on load!

    The code I am using is:

    Dim grp As RadPanelBarGroupElement = rpbMatch1.Items(x)
    grp.Caption = dr.Item("MatchingHeading").ToString
    grp.Expanded = False

    But they still show up expanded.

    Worse though is another problem I am unable to overcome.  Each of my panels is hosting a radlistbox.  There are three panels and, when all are expanded, I want the listboxes to all be visible on screen, with no scrollbar on the panel bar control (if the listboxes contain more entries than can show then each list bar gets a scroll bar). 

    The listboxes have a fixed height of 60.  when the panels are expanded there is white space below each listbox eaven though I had preset the maximum size of the content panels to 63.  Is there a minimum height for the content panel (I tried creating an example to send you and, with teh panels set to a height 0f 90, it works as expected)
  5. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 17 Jul 2008 Link to this post

    Hello Andrew,

    Thank you for getting back to me:

    In order to collapse all GroupElements you have to use only one of the following GroupStyle: ExplorerBarStyle or VisualStudio2005ToolBox. There is a known issue with the Expanded property of RadPanelBarGroupElement but you can workaround it by setting the property first to true and then to false.

    You can manage the size of  ContentPanel by setting its MinimumSize.Height and MaximumSize.Height property. I have tested a scenario similar to the one you've described by adding RadListBox to each ContentPanels with docked state set to Fill.

    Please review the code-block below as reference:
    private void Form1_Load(object sender, EventArgs e) 
        this.radPanelBar2.GroupStyle = PanelBarStyles.ExplorerBarStyle; 
        //or 
        //this.radPanelBar2.GroupStyle = PanelBarStyles.VisualStudio2005ToolBox; 
     
        this.radPanelBarGroupElement1.ContentPanel.MinimumSize = new Size(0, 30); 
        this.radPanelBarGroupElement1.ContentPanel.MaximumSize = new Size(0, 30); 
     
        this.radPanelBarGroupElement2.ContentPanel.MinimumSize = new Size(0, 50); 
        this.radPanelBarGroupElement2.ContentPanel.MaximumSize = new Size(0, 50); 
     
        this.radPanelBarGroupElement3.ContentPanel.MinimumSize = new Size(0, 120); 
        this.radPanelBarGroupElement3.ContentPanel.MaximumSize = new Size(0, 120); 
     
        foreach(RadPanelBarGroupElement panel in this.radPanelBar2.Items) 
        { 
            panel.Expanded = true
            panel.Expanded = false
        } 

    I hope this helps. If this does not exactly suite to your scenario, please send me an example project and  describe what you want to achieve. It will help me to understand your case and provide you with further assistance.

    Best wishes,
    Martin Vasilev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top