BindingSource.ApplySort Method (PropertyDescriptor, ListSortDirection)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com 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 Overridable Sub ApplySort (
	property As PropertyDescriptor,
	sort As ListSortDirection
)

Parameters

property
Type: System.ComponentModel.PropertyDescriptor

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

sort
Type: System.ComponentModel.ListSortDirection

A ListSortDirection indicating how the list should be sorted.

Exception Condition
NotSupportedException

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
Show: