We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to control ribbon tabs programmatically

Thread ID:





119213 May 22,2015 05:43 PM UTC May 28,2015 09:54 AM UTC WPF 4
Tags: Ribbon
Asked On May 22, 2015 05:43 PM UTC

I am using the latest WPF Ribbon control.
How do I programmatically (a) select a particular ribbon tab (b) show/hide a particular ribbon tab?
Thanks for any pointers.

Replied On May 24, 2015 08:58 AM UTC

OK, (b) is obvious: 
      tab1.Visibility = Visibility.Visible
or   tab1.Visibility = Visibility.Collapsed
But (a) less so: 
      tab1.IsChecked = true  

But this does not suffice to hide a ribbon tab's contents, only hide the tab's label. So hiding a tab requires switching to another:

      tab1.IsChecked = false
      tab1.Visibility = Visibility.Collapsed
      tab2.Visibility = Visibility.Visible
      tab2.IsChecked = true


Mariappan S [Syncfusion]
Replied On May 25, 2015 01:17 PM UTC

Hi Peter,

Thank you for contacting Syncfusion support.

In our current implementation of Ribbon control, we can control the RibbonTab using the properties "Visibility". While the particular RibbonTab visibility is collapsed, the first RibbonTab will get selected. This is the behavior of RibbonTab. Can you please explain your requirement clearly, it would help us to solve the problem earlier
Please let us know if you need further assistance.

Mariappan S.

Replied On May 26, 2015 07:22 AM UTC

You ask me to explain my requirements further and you say: "While the particular RibbonTab visibility is collapsed, the first RibbonTab will get selected. "
My requirements are to make a certain ribbon tab normally invisible (collapsed) but in a certain context (user selection of a particular page in the application) this tab to become both visible and selected. When I say "selected" I mean as if the tab was always visible and the user clicked on this tab.
My application has 3 ribbon tabs: "Schematic" (visible), "Model" (visible) and "Chart" (normally collapsed). Ideally I want the "Chart" tab to become both visible and the currently selected tab in a certain context (see Q3 below) but so far I've only managed to make this work using explicit code.
In the 3 images at http://postimg.org/gallery/1xedllhlg/ you will see:
Images #1. "Chart" tab Visibility is Collapsed. Tab and its contents are invisible and the first ("Schematic") tab is shown. Correct.
Image #2. "Chart" tab Visibility set to Visible and IsChecked set to true. The "Chart" tab and its contents are now the currently selected tab. Correct.
Image #3. "Chart" tab Visibility set back to Collapsed. The tab label is invisible but the tab contents remain visible and selected. It does not behave like your statement above. As far as I can tell the extra step required is to set IsChecked = true on some other tab.
So my followup questions are:
1. Is the "Visibility" property supposed to only affect the tab label and not the tab contents (as I find above)?
2. Is the "IsChecked" property the correct way to select (make current) a particular tab in code?
2. Do you have any examples of the use of the ContextTabGroup? This feels like what I should be using but the one page of documentation on this is completely lacking on what it does or how to use it.

Mariappan S [Syncfusion]
Replied On May 28, 2015 09:54 AM UTC

Hi Peter,

We were able to reproduce the issue and have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates


Please let me know if you have any questions.

Mariappan S


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon