IBindingList.ApplySort(PropertyDescriptor, ListSortDirection) 方法

定義

根據 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)

參數

property
PropertyDescriptor

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

direction
ListSortDirection

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

例外狀況

備註

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

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

給實施者的注意事項

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

適用於