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

SelectionChanged-Event is not raised

4 Answers 109 Views
RibbonView and RibbonWindow
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 25 Aug 2011, 06:32 PM
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

4 Answers, 1 is accepted

Sort by
0
Accepted
Tina Stancheva
Telerik team
answered on 29 Aug 2011, 09:52 AM
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 >>

0
Thomas
Top achievements
Rank 1
answered on 29 Aug 2011, 10:33 AM
Hello Tina,

with the latest internal build it works perfect.

thank you,
Thomas
0
Patricia
Top achievements
Rank 1
answered on 19 Jan 2012, 05:52 PM
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.

0
Tina Stancheva
Telerik team
answered on 24 Jan 2012, 10:19 AM
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 >>

Tags
RibbonView and RibbonWindow
Asked by
Thomas
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Thomas
Top achievements
Rank 1
Patricia
Top achievements
Rank 1
Share this question
or