show ribbon tag from code

4 posts, 0 answers
  1. rebtech
    rebtech avatar
    29 posts
    Member since:
    Jun 2007

    Posted 17 Dec 2010 Link to this post

    ok here is what I want to do, and I can't get it to work right.  I have set up a few tabs.  then I want to hide the tabs with

    Telerik.WinControls.

     

    ElementVisibility.Collapsed;
    then I want to show the ribbon tab based on code.  No matter what I try I cann't seem to get it to work.

    Thanks for the help

     umm i tried to change the title to Tab but it wont let me :P

     

  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 20 Dec 2010 Link to this post

    Hello,

    Please can you explain in more detail about the item that you would like to hide / show programatically and I will do my best to help
    Thanks
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 22 Dec 2010 Link to this post

    Hello again rebtech,

    It dawned on me that you probably want to expand and collapse the RibbonBar (as you normally would be double clicking on a tab). If this is the case, please take a look at this forum post

    Hope that helps
    Richard
  5. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 23 Dec 2010 Link to this post

    Hi rebtech,

    Thank you for the writing.

    In case you want to collapse or expand a RadRibbonBar group, you should collapse the approach demonstrated below. If you want to collapse the whole RadRibbonBar, you should follow the suggestion provided by Richard.

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

    The values of CollapseToStep are:

    Copy Code
    public enum ChunkVisibilityState : int
    {
    Expanded = 1,
    SmallImages = 3,
    NoText = 2,
    Collapsed = 4
    }

    You can easily collapse any collapsible element with the CollapseElementToStep method and expand it with the ExpandElementToStep method. 
    Please refer to the attached project for more details. 

    Greetings,
    Peter
    the Telerik team
    Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
Back to Top