How to utilize PreviewSelectionChanged effectively?

2 posts, 0 answers
  1. Sean
    Sean avatar
    8 posts
    Member since:
    Apr 2011

    Posted 06 Jun 2011 Link to this post

    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.
  2. Hristo
    Admin
    Hristo avatar
    352 posts

    Posted 09 Jun 2011 Link to this post

    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
  3. DevCraft banner
Back to Top