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

How to utilize PreviewSelectionChanged effectively?

1 Answer 64 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 1
Sean asked on 06 Jun 2011, 09:03 AM
I am capturing the PreviewSelectionChanged event in my ViewModel successfully. I want to validate data on the page and show a confirmation dialog and cancel the tab change or not depending on the DialogResult. Can I please have an example on how to do this? I can also accomplish this if someone shows me how to access the indices of items in e.AddedItems and e.RemovedItems.

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 09 Jun 2011, 10:18 AM
Hello Sean,

You can take a look at the following movie http://channel9.msdn.com/Events/MIX/MIX11/OPN03 about how to show message box from the view model (at minute 23, there are two approaches you can choose from).

Regarding the indices. Actually in the e.Removed items and e.AddedItems you have the instances of your view model objects. Simply you should check their indices in the collection property you are binding to the RadTabControl.ItemsSource.

Hope this helps.

All the best,
Hristo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TabControl
Asked by
Sean
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or