This article "Write a Sortable ObservableCollection for WPF" appears to be all that's needed (for me) to handle any need to sort ObservableCollection
. However, there might be scenarios that need a more complex design. Or, on the other extreme, there may be a way to prevent this need for a sort by design. Am I on the right track here or is this question moot?
views:
39answers:
2
+3
A:
This depends on whether you are trying to persist the user-selected ordering, like if the user is prioritizing items.
If the sorting is for display purposes only as is more common, CollectionView
and CollectionViewSource
are well-adapted to sorting and filtering collections in various ways in the WPF UI.
Jay
2010-09-11 02:16:35
Ah, yes, the nedd to sort sort `ObservableCollection` is more of a Silverlight issue since `CollectionView` and `CollectionViewSource` have not been fully supoorted in Silverlight.
rasx
2010-09-13 17:40:48
+1
A:
I have created one application that allows you to Sort, filter, implace editing based on User interaction.
http://www.abhisheksur.com/2010/08/woring-with-icollectionviewsource-in.html
You can check this out, it might help. Sorted ObservableCollection is basically very expensive.
abhishek
2010-09-11 20:29:48