This is a migrated thread and some comments may be shown as answers.

show ribbon tag from code

3 Answers 61 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
rebtech
Top achievements
Rank 1
rebtech asked on 18 Dec 2010, 03:29 AM
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

 

3 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 20 Dec 2010, 11:43 AM
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
0
Richard Slade
Top achievements
Rank 2
answered on 22 Dec 2010, 01:06 PM
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
0
Peter
Telerik team
answered on 23 Dec 2010, 04:14 PM
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.
Tags
RibbonBar
Asked by
rebtech
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Peter
Telerik team
Share this question
or