BindingSource.ApplySort 方法

定義

使用一或多個指定的排序描述,對資料來源排序。Sorts the data source with the specified sort description or descriptions.

多載

ApplySort(PropertyDescriptor, ListSortDirection)

使用指定的屬性描述項和排序方向,對資料來源排序。Sorts the data source using the specified property descriptor and sort direction.

ApplySort(ListSortDescriptionCollection)

使用指定的排序描述,對資料來源排序。Sorts the data source with the specified sort descriptions.

ApplySort(PropertyDescriptor, ListSortDirection)

使用指定的屬性描述項和排序方向,對資料來源排序。Sorts the data source using the specified property descriptor and sort direction.

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

參數

property
PropertyDescriptor

PropertyDescriptor,描述排序資料來源所依據的屬性。A PropertyDescriptor that describes the property by which to sort the data source.

sort
ListSortDirection

ListSortDirection,指出應該如何排序清單。A ListSortDirection indicating how the list should be sorted.

實作

例外狀況

資料來源不是 IBindingListThe data source is not an IBindingList.

備註

IBindingList會使用來執行單一資料行排序, PropertyDescriptor 以指出要排序的屬性,以及 ListSortDirection 指出屬性內容是否應該以遞增或遞減順序排序。The IBindingList implements single column sorting using a PropertyDescriptor to indicate a property to sort by and a ListSortDirection indicating whether the property contents should be sorted in ascending or descending order.

適用於

ApplySort(ListSortDescriptionCollection)

使用指定的排序描述,對資料來源排序。Sorts the data source with the specified sort descriptions.

public:
 virtual void ApplySort(System::ComponentModel::ListSortDescriptionCollection ^ sorts);
public virtual void ApplySort (System.ComponentModel.ListSortDescriptionCollection sorts);
abstract member ApplySort : System.ComponentModel.ListSortDescriptionCollection -> unit
override this.ApplySort : System.ComponentModel.ListSortDescriptionCollection -> unit
Public Overridable Sub ApplySort (sorts As ListSortDescriptionCollection)

參數

sorts
ListSortDescriptionCollection

ListSortDescriptionCollection,包含要套用至資料來源的排序描述。A ListSortDescriptionCollection containing the sort descriptions to apply to the data source.

實作

例外狀況

資料來源不是 IBindingListViewThe data source is not an IBindingListView.

備註

IBindingListView 實作為一組屬性描述項方向配對的多重資料行排序。IBindingListView implements multi-column sorting as a set of property descriptor-direction pairs.

適用於