SortBy Rank

Here is an example that demonstrates some of the sort order specification that are available in the GridSort class.

Example
Rank
Group
2B
1A
4B
3A

Keep numbers always sorted ascending inside the group when sorting by group

Rank
Group
2B
1A
4B
3A
Download: 

Column Key Sort

In some instances, your dataset may not have a property on the class that can be used for sorting. In this instance, you can supply a ColumnKeyGridSort that allows you to specify the name of your column and supply the logic for sorting.

Example
First Name
Last Name
TomCruise
DollyParton
NicoleKidmon
JamesBond
Download: 

Documentation

GridSort<TGridItem> Class

Methods

Name
Parameters
Type
Description
ApplyIQueryable<TGridItem> queryable
bool ascending
IOrderedQueryable<TGridItem>
ByAscending<U>Expression<Func<TGridItem, U>> expression
GridSort<TGridItem>
Produces a GridSort instance that sorts according to the specified expression
using the specified comparer, ascending.
ByAscending<U>Expression<Func<TGridItem, U>> expression
IComparer<U> comparer
GridSort<TGridItem>
Produces a GridSort instance that sorts according to the specified expression
using the specified comparer, ascending.
ByDescending<U>Expression<Func<TGridItem, U>> expression
GridSort<TGridItem>
Produces a GridSort instance that sorts according to the specified expression
using the specified comparer, descending.
ByDescending<U>Expression<Func<TGridItem, U>> expression
IComparer<U> comparer
GridSort<TGridItem>
Produces a GridSort instance that sorts according to the specified expression
using the specified comparer, descending.
ThenAlwaysAscending<U>Expression<Func<TGridItem, U>> expression
GridSort<TGridItem>
Updates a GridSort instance by appending a further sorting rule.
ThenAlwaysAscending<U>Expression<Func<TGridItem, U>> expression
IComparer<U> comparer
GridSort<TGridItem>
Updates a GridSort instance by appending a further sorting rule.
ThenAlwaysDescending<U>Expression<Func<TGridItem, U>> expression
GridSort<TGridItem>
Updates a GridSort instance by appending a further sorting rule.
ThenAlwaysDescending<U>Expression<Func<TGridItem, U>> expression
IComparer<U> comparer
GridSort<TGridItem>
Updates a GridSort instance by appending a further sorting rule.
ThenAscending<U>Expression<Func<TGridItem, U>> expression
GridSort<TGridItem>
Updates a GridSort instance by appending a further sorting rule.
ThenAscending<U>Expression<Func<TGridItem, U>> expression
IComparer<U> comparer
GridSort<TGridItem>
Updates a GridSort instance by appending a further sorting rule.
ThenDescending<U>Expression<Func<TGridItem, U>> expression
GridSort<TGridItem>
Updates a GridSort instance by appending a further sorting rule.
ThenDescending<U>Expression<Func<TGridItem, U>> expression
IComparer<U> comparer
GridSort<TGridItem>
Updates a GridSort instance by appending a further sorting rule.
ToPropertyListbool ascending
IReadOnlyCollection<SortedProperty>
An error has occurred. This application may no longer respond until reloaded. Reload 🗙