2 posts, 1 answers
  1. Brad Childs
    Brad Childs avatar
    1 posts
    Member since:
    May 2010

    Posted 02 May 2012 Link to this post

    How do you raise the MouseLeftButtonDownEvent on a RadRibbonTab?

    I have tried the following:

    RadRibbonTab tmp;
    tmp.RaiseEvent(new RadRoutedEventArgs(RadRibbonTab.MouseLeftButtonDownEvent));


    RadRibbonTab.MouseLeftButtonDownEvent is of type System.Windows.RoutedEvent and RadRoutedEventArgs wants a Telerik.Windows.RoutedEvent.

    I have also tried:

    EventInfo eventInfo = typeof(RadRibbonTab).GetEvent("MouseLeftButtonDown");
    var raiseMethod = eventInfo.GetRaiseMethod()
    raiseMethod.Invoke(tmp, null);


    raiseMethod is always null.

    Is there some other way of clicking the tab programmatically?  Note, I do NOT want to use SelectedIndex or SelectedItem.  I want to simulate a mouse click.

  2. Answer
    Miro Miroslavov
    Miro Miroslavov avatar
    588 posts

    Posted 07 May 2012 Link to this post

    Hello Brad,

     Since the MouseLeftButtonEvent is the built-in silverlight mouse event, you can not raise outside of the framework element you're targeting. You may refer to this forum for more information. What I can suggest you is to use automation peers instead. So you can get the respective automation peer for the RadRibbonTab and force Selection through the peer which should behave exactly as it is clicked. 
    Please let us know if this is what you need.

    All the best,
    Miro Miroslavov
    the Telerik team

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

  3. DevCraft R3 2016 release webinar banner
Back to Top