BindingSource.ApplySort Method (PropertyDescriptor, ListSortDirection)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Sorts the data source using the specified property descriptor and sort direction.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public virtual void ApplySort(
	PropertyDescriptor property,
	ListSortDirection sort


Type: System.ComponentModel.PropertyDescriptor

A PropertyDescriptor that describes the property by which to sort the data source.

Type: System.ComponentModel.ListSortDirection

A ListSortDirection indicating how the list should be sorted.

Exception Condition

The data source is not an IBindingList.

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.

.NET Framework
Available since 2.0
Return to top