|
|
Sorting
Essential Grouping supports multikey sorting without relying on ADO.NET. It will sort any IList data source.
|
|
|
|
Essential Grouping sorting support is flexible, and not restricted to ADO.NET DataView sorting. Users may sort any IList datasource. The sorting is straight-forward to use. The following screenshot shows code to sort a collection on two keys.
Code to perform a multikey sort
|
|
|
|
Users may provide an IComparer object to customize the sort behavior. With IComparer objects, it is possible to do things like always position empty values at the bottom of the sorts.
The following is a graphic detailing the use of a custom IComparer object. In the picture, column B has values like b73, b31, etc. By default, this column would be sorted alphabetically. But with a custom sort, a user may strip off the leading 'b', and have the column displayed numerically sorted ignoring the 'b'. The picture shows both the default and custom sort results.
Sort results from both a default sort and a custom sort on column B
|
|
|
|
If a collection has been grouped, subsequent sorts will respect the grouping, arranging the items with the groups.
|
|
|
|
|
|
|