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

[Solved] How can I keep keep sorting options when calling and returning from an action method ?

1 Answer 61 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.
julien test
Top achievements
Rank 1
julien test asked on 17 Dec 2009, 11:13 PM
Hi,

The MVC Grid control is really great but I'm stuck with a problem with sorting....

I have a grid with a rank column and just next to it a templated column containing 2 arrows (up & down).

Each of these arrows point to an action method call (synchronous HTTP GET) to change the value of the rank up or down.

Let's say, I go to the page 7 and sort by rank  then I click on the up arrow...

The proper action method is called then redirects to the Index which re-displays the grid.

It works but when the grid is displayed, I lost the way the items were sorted & paged !

How could I keep the  paging & sorting options so I'm not lost when I come back from the action method ?

I understand  that the query string makes the paging and sorting... Is there a way to send this query string to the action method and use it to tell the Grid how it has to be rendered in terms of paging and sorting ?

Thanks a lot for your help,

Regards.

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 18 Dec 2009, 12:59 PM
Hi julien test,

You should use a custom route for the grid built-in operations. Just make sure the route is registered before the default one.

Regards,
Atanas Korchev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
julien test
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or