views:

29

answers:

0

I get "'System.Windows.Data.BindingListCollectionView' view does not support sorting." when I use the following CollectionViewSource:

    <CollectionViewSource Source="{Binding Path=CourseSessions}" x:Key="cvsCourses">
        <CollectionViewSource.SortDescriptions>
            <ComponentModel:SortDescription PropertyName="StartDate"/>
        </CollectionViewSource.SortDescriptions>
    </CollectionViewSource>

The DataContext is an ObservableCollection<Course>. I am using Entity Framework 4 and CourseSessions is a property of Course:

public ObjectSet<CourseSession> CourseSessions

How can I specify sorting in this case, short of sorting the data coming out of the database?