SelectionChanged-Event is not raised

5 posts, 1 answers
  1. Thomas
    Thomas avatar
    3 posts
    Member since:
    Jun 2009

    Posted 25 Aug 2011 Link to this post

    Hi,
    I have a little problem here with the WPF RibbonView-Control:
    The SelectionChanged-Event is not raised, when a RibbonTab is selected.
    The PreviewSelectionChanged-Event works as expected.

    To be sure, that there are no side effects from my application, I made a simple
    wpf app (VS2010, .NET Framework 4, Q2 2011) with a RadRibbonWindow, RadRibbonView,
    two empty RibbonTabs and the SelectionChangedEvent. Same effect.

    Any Idea, what I am doing wrong?

    thanks, 
    Thomas
  2. Answer
    Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 29 Aug 2011 Link to this post

    Hello Thomas,

    You're not doing anything wrong. This issue was introduced in the Q2 2011 release but it is now fixed and you can test it with the latest internal build. Please give it a try and let us know how it goes.

    Best wishes,
    Tina Stancheva
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Thomas
    Thomas avatar
    3 posts
    Member since:
    Jun 2009

    Posted 29 Aug 2011 Link to this post

    Hello Tina,

    with the latest internal build it works perfect.

    thank you,
    Thomas
  5. Patricia
    Patricia avatar
    7 posts
    Member since:
    Dec 2011

    Posted 19 Jan 2012 Link to this post

    If you click on the Backstage tab (orange) the previewselectionchanged event fires but NewItems count is 0 and e.handled = true does nothing.  It still changes to that tab.  I also tried to set up the previewseslectionchanged event on the RadRibbonBackstage but it only fires when the application is started up.  After that, changing tabs on fires the previewselectionchanged event on the RibbonView. 

    I need to prevent the tabs from changing if there on changes on a particular tab so I can ask the user if they want to save.

  6. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 24 Jan 2012 Link to this post

    Hello Trish,

    I will post the information I gave you in the support ticket here as well, just in case anyone else encounters similar issues:

    Since the PreviewSelectionChanged event is a tunneling event, it is first handled by the root elements of the visual tree and then the event travels through the child elements till it reaches the one that originally has raised it. This is why when you trigger a selection change both in the RibbonView and in the RibbonBackstage, the RibbonView.PreviewSelectionChanged will be invoked first. This means that you can use only this event to handle a selection change.


    Also, you need to keep in mind that in order to track the selection of a RibbonBackstageItem, the item should be selectable (its IsSelectable property should be set to True). And there are two RibbonBackstageItem properties that affect the selection:

    • IsDefault - specifies whether the item should be selected when the Backstage is opened.
    • IsSelected - controls the selection state of an item


    All the best,
    Tina Stancheva
    the Telerik team

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

Back to Top
UI for WPF is Visual Studio 2017 Ready