|
|
Sorting
Essential Grouping supports multi-key sorting without relying on ADO.NET. It will sort any IList data source. Essential grouping also supports IComparer and respects groups within a sort collection.
|
|
|
|
Essential Grouping's sorting support is flexible and not restricted to ADO.NET DataView sorting. Users can sort any IList datasource. The sorting is straight-forward and easy to use. A code to sort a collection on two keys is provided below:
Code to Perform Multi-key Sort
|
|
|
|
Users can provide an IComparer object to customize sort behavior. IComparer objects enable the user to perform functions such as positioning of empty values at the bottom of the sort.
The use of a custom IComparer object is illustrated below:
Sort Results for Default Sort and Custom Sort on Column 'B'
Column B has values-b73, b31, and so on. The default setting would sort this column aphabetically. With custom sort, a user can ignore the leading 'b' and display a numerically sorted column.
|
|
|
|
Essential Grouping supports grouping withing sorts. Performing a sort on a collection conatining grouped data will result in an output where the collection items are sorted with the pre-existing groups intact. Sorting will respect groups.
|
|
|
|
|
|
|