This is a migrated thread and some comments may be shown as answers.

[Solved] Need Help in Defining the Initial Sort Direction of a Group

0 Answers 8 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Christopher
Top achievements
Rank 1
Christopher asked on 20 Mar 2012, 01:17 AM
Hello, I need help in defining the initial sort direction (ASC or DESC) of the grouping. In my code below, I grouped the grid entries based on the "Year". The entries are grouped perfectly except that the grouping is by default ascending (which in my case the group of the oldest year is shown first). Now all I wanted is to put the latest year at the top (descending). Now how would I translate this into code?


.Sortable(sorting => sorting
    .SortMode(GridSortMode.MultipleColumn)
    .OrderBy(sortOrder =>
    {
        sortOrder.Add(o => o.Place).Ascending();
        sortOrder.Add(o => o.FullName).Ascending();
    })
)
.Groupable(grouping => grouping.Groups(groups => groups.Add(o => o.Year)))


Thanks for your inputs.
Tags
Grid
Asked by
Christopher
Top achievements
Rank 1
Share this question
or