SortBy Rank
Here is an example that demonstrates some of the sort order specification that are available in the GridSort
class.
Rank | Group |
---|---|
2 | B |
1 | A |
4 | B |
3 | A |
Keep numbers always sorted ascending inside the group when sorting by group
Rank | Group |
---|---|
2 | B |
1 | A |
4 | B |
3 | A |
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.
First Name | Last Name |
---|---|
Tom | Cruise |
Dolly | Parton |
Nicole | Kidmon |
James | Bond |
Download:
Documentation
GridSort<TGridItem> Class
Methods
Name | Parameters | Type | Description |
---|---|---|---|
Apply | IQueryable<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 expressionusing 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 expressionusing the specified comparer, ascending. |
ByDescending<U> | Expression<Func<TGridItem, U>> expression | GridSort<TGridItem> | Produces a GridSort instance that sorts according to the specified expressionusing 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 expressionusing 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. |
ToPropertyList | bool ascending | IReadOnlyCollection<SortedProperty> |