Hiding a RadRibbonBarGroup

4 posts, 0 answers
  1. David
    David  avatar
    67 posts
    Member since:
    Aug 2010

    Posted 10 Jan 2012 Link to this post

    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
  2. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 13 Jan 2012 Link to this post

    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).

  3. Mas
    Mas avatar
    6 posts
    Member since:
    Sep 2018

    Posted 06 Sep 2018 Link to this post

    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 ? 

     

  4. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3479 posts

    Posted 07 Sep 2018 Link to this post

    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).

Back to Top