0

In Windows RT, the ListBox seems to be missing the Sort method. How would I sort the items alphabetically?

msbg
  • 4,852
  • 11
  • 44
  • 73

1 Answers1

2

You sort the list it's bound on, usually by sorting the list directly, since sorting and filtering the ICollectionView have been omitted in WinRT. See Creating a Sorted Collection View in WinRT for more information.

Community
  • 1
  • 1
akton
  • 14,148
  • 3
  • 43
  • 47
  • Sorting and filtering are the responsibilities of the view model. Sorting prior to placing data in the view model is taking us back at least a decade in terms of architecture. In addition, anyone developing live data applications are going to see an unacceptable amount of refreshing when the list resets with every change. – Quark Soup Apr 19 '14 at 19:16
  • 1
    @DRAirey1 I agree. However, WinRT does not support sorting and filtering ICollectionView, unlike WPF. Downvote WinRT, not the correct answer :-). – akton Apr 20 '14 at 00:46
  • 1
    "You sort the list it's bound on, usually by sorting the list directly" is not an answer to the OP's question. This link has a more acceptable answer: http://www.codeproject.com/Articles/527686/A-WinRT-CollectionView-class-with-Filtering-and-So. It begs the question: is Microsoft trying to alienate WPF developers? It would have been trivial for the MS team to give this job to an intern and would have make our life less of a living hell trying to create MVVM applications for the tablet. – Quark Soup Apr 21 '14 at 11:51