CollectionView implements the ICollectionView interface to support sorting data in ascending and descending order. It enables you to sort data according to the specified sort path and direction using SortAsync method of the C1CollectionView class. CollectionView also allows you to set the direction of sort operation using Direction property of the SortDescription class which accepts values from the SortDirection enumeration. Moreover, it allows you to specify the path of a data item to which the sort operation needs to be applied using the SortPath property.
The following GIF displays how the sorting is implemented using the SortAsync method.
The following code demonstrates the implementation of the SortAsync method to sort data in DataGridView. In this example, Name column of DataGridView is sorted alphabetically in ascending order. This example uses the sample created in the Quick Start section.