Collapse RadRibbonBarGroup not working

4 posts, 1 answers
  1. Gary
    Gary avatar
    3 posts
    Member since:
    Nov 2010

    Posted 29 Nov 2010 Link to this post

    I am using WinForms Q2 2010 SP2 RadRibbonBar control.  According to, the right-most RadRibbonBarGroup will collapse to a simple rectangle when the form containing the RadRibbonBar is resized smaller than the RadRibbonBarGroup size.  This isn't working for me.  When I resize the form to a smaller size, ALL of the RadRibbonBarGroups collapse AND none of them collapse to a simple rectangle.  How do I manage this programatically?
  2. Gary
    Gary avatar
    3 posts
    Member since:
    Nov 2010

    Posted 30 Nov 2010 Link to this post

    Just to expand a bit. The section of the project I am working on is allowing the user to create an ad-hoc query where each RadRibbonBarGroup hosts a user control to help the user select a specific element of the query.  What I actually need to do, after I can get control over ALL of the RadRibbonBarGroups collapsing when the form is smaller than their total widths combined, is to gain programatic control over collapsing and expanding any selected RadRibbonBarGroup.

    The RadRibbonBarGroup.Visibility property doesn't do this for me.

    // shows the hosted control in it's occupied space.
    radRibbonBarGroup3.Visibility = ElementVisibility.Visible 
    // hides the hosted control and leaves the would-be occupied space empty.
    radRibbonBarGroup3.Visibility = ElementVisibility.Hidden 
    // hides the element completely, as it should.
    radRibbonBarGroup3.Visibility = ElementVisibility.Collapsed

    1. But which property do I set to collapse the RadRibbonBarGroup to a simple rectangle that contains the down-arrow icon (that dispays the hosted control when clicked)?
    2. What property do I set to change the image from a down-arrow icon to one of my choosing?

  3. Answer
    Peter avatar
    1159 posts

    Posted 02 Dec 2010 Link to this post

    Hi Gary,

    Thank you for the writing.

    The collapse operation in RibbonBar is performed in the public class ExpandableStackLayout and each item in this StackLayout that inherits from the public abstract class CollapsibleElement can be expanded or collapsed. By default, ExpandableStackLayout checks if the sum of all sizes of the elements are larger than the available space and calls CollapseToStep method for these elements with CollapseStep smaller than CollapseMaxSteps.

    The values of CollapseToStep are:

    public enum ChunkVisibilityState : int
    Expanded = 1,
    SmallImages = 3,
    NoText = 2,
    Collapsed = 4

    You can easily collapse any collapsible element with CollapseElementToStep method and expand with ExpandElementToStep method.

    For more details please refer to the attached project.

    I hope this helps.

    Kind regards,
    the Telerik team
    Get started with RadControls for WinForms with numerous videos and detailed documentation.
  4. Gary
    Gary avatar
    3 posts
    Member since:
    Nov 2010

    Posted 02 Dec 2010 Link to this post

    That worked.  Thank you very much.

    Your product is great!
Back to Top