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

Hiding a RadRibbonBarGroup

3 Answers 388 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 2
David asked on 10 Jan 2012, 05:38 PM
Hi,

I have a RadRibbonBar with a RibbonTab and on the Tab I have a few RadRibbonBarGroups I want to hide one of these groups in code. So I have put

BBG_Toggle.Visibility =
ElementVisibility.Hidden;

This hides the RadRibbonBarGroups but the other RadRibbonBarGroups I have on the Tab do not automaticly float to the left of the ribbon bar. I also cannot find a way to move the other groups over eaither. is this possible?

Thanks

3 Answers, 1 is accepted

Sort by
0
Ivan Todorov
Telerik team
answered on 13 Jan 2012, 10:18 AM
Hi David,

Thank you for your question.

When an element's Visibility is set to Hidden, it continues to occupy its usual space, but it is not drawn on the control (e.g. it still participates in the layout). If you want to hide an element and free the space it occupies, you should set its Visibility to Collapsed:
BBG_Toggle.Visibility = ElementVisibility.Collapsed;

I hope you find this useful. Feel free to write back if you have any further questions.

Kind regards,
Ivan Todorov
the Telerik team

SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).

0
Mas
Top achievements
Rank 1
answered on 06 Sep 2018, 01:58 PM

Hi, I am currently evaluating Telerik for my project. I need to use Richtexteditor for my winform application. What I need is to hide all commandtab but Review tab, and also to hide all button groups inside Review tab but Comment.

 I know I can hide ribbonbar commantab easily by set its visibility to collapsed. But, how to hide button groups inside command tab ? 

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 07 Sep 2018, 08:57 AM
Hello, Mas,          

In order to customize the Ribbon UI in RadRichTextEditor and hide some command tabs or groups inside a specific tab, you can create a derivative of the RichTextEditorRibbonBar and override its Initialize method. After the basic logic is performed you can hide the desired elements. Here is demonstrated a sample code snippet:

public class CustomRichTextEditorRibbonBar : RichTextEditorRibbonBar
{
    protected override void Initialize()
    {
        base.Initialize();
 
        this.CommandTabs[2].Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
 
        this.tabHome.Items[0].Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
        this.groupFootnotes.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
    }
}

Then, in the Designer.cs file replace the default RichTextEditorRibbonBar to be the custom one.

If you need any further assistance please don't hesitate to contact me.

Kind regards,
Dess
the Telerik team

SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).

Tags
RibbonBar
Asked by
David
Top achievements
Rank 2
Answers by
Ivan Todorov
Telerik team
Mas
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or