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

Ajax grid not posting init routedata when parent action has parameters

2 Answers 54 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.
Alex
Top achievements
Rank 1
Alex asked on 11 May 2012, 10:20 PM
I have an ajax bound grid.  I can set initial parameters like this:

RouteData.Values[gridName + GridUrlParameters.PageSize] = value;

This works fine.  I can hit the refresh button and the GridCommand settings get submitted from the page loading action, thus keeping the grid settings.

I now need to modify the parent action that returns the View containing the grid configuration.  I added a couple of optional parameters to it.  This simple and (should be innocent) change prevents the RouteData.Values from being posted on first page load.  I can use the filter or sorting ok, but as soon as I hit refresh all changes are lost.  The values are just not being posted - the GridCommand object contains default values.  Please help.

Thank you.

Alex

2 Answers, 1 is accepted

Sort by
0
Alex
Top achievements
Rank 1
answered on 14 May 2012, 03:43 PM
I think this is a serious issue.  I spent an entire day trying to get it to work.  I used MVC Routing to get rid of the query string - that didn't help.  I tried changing all kinds of other parameters without success.  Grid default value initialization only works if the action has not parameters (optional or not, doesn't matter).

I implemented the following workaround, which is a temporary solution since I think the root issue needs to be fixed.  I created new actions with parameters which write the values to Response.Cookies and return RedirectToAction to my regular page action, which reads/deletes the cookie.  This is a very hacked up way to parameters into an action but it's the only thing that works.

Alex 
0
rob
Top achievements
Rank 1
answered on 29 May 2012, 07:10 PM
I'm having the exact issue...any input from anyone at Telerik?
Tags
Grid
Asked by
Alex
Top achievements
Rank 1
Answers by
Alex
Top achievements
Rank 1
rob
Top achievements
Rank 1
Share this question
or