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

[Solved] Multi-column sort

2 Answers 111 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.
Bob
Top achievements
Rank 1
Bob asked on 02 Jun 2012, 12:53 AM
I see in the docs how to enable the client to do multi-column sorting. however, I don't see how I can set up the initial orderby to include multiple columns. What would the syntax for that be?

BOb

2 Answers, 1 is accepted

Sort by
0
Accepted
Petur Subev
Telerik team
answered on 04 Jun 2012, 08:11 AM
Hi Bob,

Basically you can set the sorting order initially for multiple columns like this:
.Sortable(sorting => sorting
    .SortMode(GridSortMode.MultipleColumn)
    .OrderBy(order =>
    {
        order.Add(c => c.ShipCountry).Ascending();
        order.Add(c => c.OrderID).Descending();
    })
)


Regards,
Petur Subev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
0
Bob
Top achievements
Rank 1
answered on 04 Jun 2012, 02:21 PM
Excellent, thanks.

BOb
Tags
Grid
Asked by
Bob
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Bob
Top achievements
Rank 1
Share this question
or