IBindingList.ApplySort(PropertyDescriptor, ListSortDirection) Method

Definition

根據 PropertyDescriptorListSortDirection 來排序清單。Sorts the list based on a PropertyDescriptor and a ListSortDirection.

public:
 void ApplySort(System::ComponentModel::PropertyDescriptor ^ property, System::ComponentModel::ListSortDirection direction);
public void ApplySort (System.ComponentModel.PropertyDescriptor property, System.ComponentModel.ListSortDirection direction);
abstract member ApplySort : System.ComponentModel.PropertyDescriptor * System.ComponentModel.ListSortDirection -> unit
Public Sub ApplySort (property As PropertyDescriptor, direction As ListSortDirection)

Parameters

property
PropertyDescriptor

要做為排序依據的 PropertyDescriptorThe PropertyDescriptor to sort by.

direction
ListSortDirection

其中一個 ListSortDirection 值。One of the ListSortDirection values.

Exceptions

Remarks

如果加入或移除專案,這些專案會以排序次序放置。If items are added or removed, these items are placed in the order of the sort.

如果 SupportsSortingtrue,則支援這個方法。否則,這個方法會擲回 NotSupportedExceptionThis method is supported if SupportsSorting is true; otherwise, this method throws a NotSupportedException.

Notes to Implementers

這個方法的執行應該會引發具有 Reset 列舉的 ListChanged 事件。The implementation of this method should raise a ListChanged event with the Reset enumeration.

Applies to