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

3 posts, 0 answers
  1. Joel
    Joel avatar
    41 posts
    Member since:
    Nov 2010

    Posted 02 Aug 2011 Link to this post

    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. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 08 Aug 2011 Link to this post

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

  3. DevCraft banner
  4. Joel
    Joel avatar
    41 posts
    Member since:
    Nov 2010

    Posted 08 Aug 2011 Link to this post

    Thanks Petar, that works great!
Back to Top