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

Disable automatically switching to contextual tab when IsActive is set to true

2 Answers 49 Views
RibbonView and RibbonWindow
This is a migrated thread and some comments may be shown as answers.
Joel
Top achievements
Rank 1
Joel asked on 02 Aug 2011, 09:57 PM
When someone clicks on a pane that has an associated contextual tab, I want the tab to appear on the RibbonView, but I don't want to always switch to it.

It seems like the currently selected tab isn't resolved until after the function that sets the IsActive property to true completes.  Usually, calling UpdateLayout() will force the UI to update, but didn't work this time.  Any ideas how to stop the contextual tab from grabbing focus?

2 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 08 Aug 2011, 09:39 AM
Hello Joel,

 You can use the PreviewSelectionChanged event of the RadRibbonView
in order to prevent the selection of the first tab in the Contextual Group.

private void Button_Click(object sender, RoutedEventArgs e)
       {
           this.ContextGroupA.IsActive = true;
           this.rribbonView.PreviewSelectionChanged += (s, ee) =>
               {
                   ee.Handled = true;
               };
       }
Please let us know if this fits in your scenario. Best wishes,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Joel
Top achievements
Rank 1
answered on 08 Aug 2011, 02:21 PM
Thanks Petar, that works great!
Tags
RibbonView and RibbonWindow
Asked by
Joel
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Joel
Top achievements
Rank 1
Share this question
or