3

When using a CollectionView in WPF and listening on CurrentChanging I want to cancel the change if the item being selected is not a valid item to select. The problem is I can't find out what item the CollectionView is changing to. If I don't know this I can't validate the item as selectable or not. How do I accomplish this with a CollectionView?

Andreas Zita
  • 7,232
  • 6
  • 54
  • 115

1 Answers1

0

Maybe you should prevent the selection of any invalid item. I would use the IDataErrorInfo Interface and bind to IsEnabled Property.

LPL
  • 16,827
  • 6
  • 51
  • 95