Is there a way to bind an ItemsControl (like ListView or DataGrid) to a sorted collection such that:
- whenever the collection is resorted via code, the
ItemsControlautomatically reflects the new sort order, - AND whenever the
ItemsControlis sorted, it re-sorts the collection?
Thank you,
Ben
You’ll need to use the
method to get the default view of your ObservableCollection and apply the sort on that.
For example, below I’m sorting the ObservableCollection named ‘authors’ by BookTitle.