Sorts the items if overridden in a derived class; otherwise, throws a NotSupportedException.
- prop
- A System.ComponentModel.PropertyDescriptor that specifies the property to sort on.
- direction
- One of the System.ComponentModel.ListSortDirection values.
The System.ComponentModel.BindingList`1 class does not provide a base implementation of sorting, so BindingList`1.ApplySortCore(PropertyDescriptor, ListSortDirection) always throws a NotSupportedException by default. To enable sorting, derive from System.ComponentModel.BindingList`1 and perform the following tasks:
Override BindingList`1.ApplySortCore(PropertyDescriptor, ListSortDirection) and implement sorting, raising the BindingList`1.ListChanged event when sorting is complete.
Override BindingList`1.RemoveSortCore and implement sort removal.
Override BindingList`1.SupportsSortingCore and set BindingList`1.SupportsSortingCore to true.
In addition, you may want to implement the supplemental BindingList`1.SortDirectionCore and BindingList`1.SortPropertyCore sorting properties.