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

Sorting issue with pagination

5 Answers 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Helen
Top achievements
Rank 1
Helen asked on 12 Oct 2010, 08:23 PM
Hi All,

We enabled radgird with AllowSorting="true", and we use pagination for the radgrid too. The issue when you click the header and let it sort, it only keep the sorting order for the that page, when it come to the rest of pages, the sort order is lost. How to solve this problem? e.g, if we want to sort it by state, we want it all the data (all pages) are sorted by state, not the page where I click the sort arrows.

Thanks for the help, really appreciate it,
Helen

5 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 13 Oct 2010, 09:26 AM
Hi Helen,

I am sending you a simple working project that is working as expected, please give it a try and let me know if it works for you.

I hope this helps.

Best wishes,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Helen
Top achievements
Rank 1
answered on 13 Oct 2010, 03:54 PM
Hi Pavlina,

Thanks for prompt reply, really appreciate it.

I've tested the solution you attached, it works fine. However, by comparing yours and mine, I found out that in your example, the data bind is on server side. Ours is on client side, when we click column header to sort, there is no page post back. It is my bad that I did not explain the issue with more details. ( We have client settings on radgrid as follows.)  If possible, would you mind giving us an example with sort function&pagination enabled working from client side?

<ClientSettings
         AllowKeyboardNavigation="true">
        <Selecting AllowRowSelect="true" />
        <DataBinding
            Location="~/Services/AjaxWebService.asmx"
            SelectMethod="GetAllExceptions"
            SelectCountMethod="GetCount"
            SortParameterType="Linq"
            EnableCaching="false">
        </DataBinding>
        <ClientEvents
            OnDataBinding="epRadGrid_DataBinding"
            OnRowSelected="epRadGrid_RowSelected"
            OnRowDeselected="epRadGrid_RowDeselected" />                
    </ClientSettings>
0
Pavlina
Telerik team
answered on 13 Oct 2010, 04:07 PM
Hi Helen,

You can examine the following online example and see if it helps:
http://demos.telerik.com/aspnet-ajax/grid/examples/client/declarativedatabinding/defaultcs.aspx

Best wishes,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Helen
Top achievements
Rank 1
answered on 13 Oct 2010, 05:09 PM
Hi Pavlina,

I tested the example on that link, seems sort function is not working properly(http://demos.telerik.com/aspnet-ajax/grid/examples/client/declarativedatabinding/defaultcs.aspx). When I sort by name, then name will remain the same for all the pages, that is not sorted correctly and kinda wired.

I just tested our current page again. We have A, S, E as start letter for the names for the 1st page, and O, P for the 2nd page. When I sort by name in asc on first page, data are showed up as A, E, S, and no O, P at all. The correct sorting should move O, P from 2nd page to the 1st page. It looks to me that it only sort (update) data from startindex and endindex of that page( set by pagination), not actually the whole data cross all pages.

Is it the expected behavior ( issue) with sort on client side with pagination? Anyway to solve it? Is it possible to update the whole data with sort and not only portion of the data with pagination?

Thanks,
Helen

0
Pavlina
Telerik team
answered on 19 Oct 2010, 08:51 AM
Hello Helen,

I tried to replicate the described issue in the online example but to no avail. Please review this video and let me know if I am leaving something out while testing.

Sincerely yours,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Helen
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Helen
Top achievements
Rank 1
Share this question
or