BindingList<T>.ApplySortCore(PropertyDescriptor, ListSortDirection) 方法

定义

如果已在派生类中重写,则对项进行排序;否则将引发 NotSupportedExceptionSorts the items if overridden in a derived class; otherwise, throws a NotSupportedException.

protected:
 virtual void ApplySortCore(System::ComponentModel::PropertyDescriptor ^ prop, System::ComponentModel::ListSortDirection direction);
protected virtual void ApplySortCore (System.ComponentModel.PropertyDescriptor prop, System.ComponentModel.ListSortDirection direction);
abstract member ApplySortCore : System.ComponentModel.PropertyDescriptor * System.ComponentModel.ListSortDirection -> unit
override this.ApplySortCore : System.ComponentModel.PropertyDescriptor * System.ComponentModel.ListSortDirection -> unit
Protected Overridable Sub ApplySortCore (prop As PropertyDescriptor, direction As ListSortDirection)

参数

prop
PropertyDescriptor

指定要用于排序的属性的 PropertyDescriptorA PropertyDescriptor that specifies the property to sort on.

direction
ListSortDirection

ListSortDirection 值之一。One of the ListSortDirection values.

例外

方法未在派生类中重写。Method is not overridden in a derived class.

注解

BindingList<T>类不提供排序的基实现,因此 ApplySortCore NotSupportedException 默认情况下始终引发。The BindingList<T> class does not provide a base implementation of sorting, so ApplySortCore always throws a NotSupportedException by default. 若要启用排序,请从派生 BindingList<T> 并执行以下任务:To enable sorting, derive from BindingList<T> and perform the following tasks:

此外,您可能还需要实现补充 SortDirectionCoreSortPropertyCore 排序属性。In addition, you may want to implement the supplemental SortDirectionCore and SortPropertyCore sorting properties.

适用于