Sunday, September 14, 2014

WPF DataGrid or ListView does not follow underlying ICollectionView selection

If you've ever used a selector derived control and ICollectionView with the IsSynchronizedWithCurrentItem property set to true, you may have noticed that the UI can get out of sync with the actual selected item.  This seems to be a bug in the underlying implementation of the selector class.

I ran into this bug recently and on Tim Valentine's blog was glad to find this solution.  It involves using an attached property to keep the UI and ICollectionView synced.

No comments:

Post a Comment