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

[Solved] Telerik MVC grid - sorting pre-sorted data on a per-page basis

0 Answers 15 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ramesh
Top achievements
Rank 1
Ramesh asked on 05 Nov 2012, 07:55 PM

I have a Telerik grid with paging enabled, at 100 items per page. I want to sort only these 100 items, per page.

This is my controller, it's returning pre-sorted data:

var listInflows = (from inf in db.CI_INFLOWS
                                   orderby inf.InvoiceDt descending
                                   select new InflowsGetModel
                                   {
                                     [omitted for brevity]

These is my Telerik settings:

.Sortable(sorting => sorting.OrderBy(so => so.Add(a => a.InvoiceDt).Ascending()))
.Pageable(paging => paging.PageSize(100)
                          .Style(GridPagerStyles.NextPreviousAndNumeric)
                          .Position(GridPagerPosition.Top)
         )

Here, I am telling the db to sort the data. Then I want the 100-per-page displayed items to sort in the reverse order. It's not behaving as expected.

Tags
General Discussions
Asked by
Ramesh
Top achievements
Rank 1
Share this question
or