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

[Solved] Grid does not work as expected with render action

0 Answers 86 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.
David
Top achievements
Rank 1
David asked on 03 Oct 2010, 05:14 PM
I am currently generating a telerik mvc grid during a render action call and I noticed that the Sort and Page actions all point to the child action that was used to render them instead of the parent action. The only action that seems to be pointing at the parent action is the refresh button beside the pager. I have tried to override this behavior using .DataBinding(db => db.Server().Select()), unfortunately that still does not work. Can someone inform me of the best way to override this behavior? Currently I have a work around in place, which will work for me but I would prefer to have this fixed.

Work Around
Create an Action Filter attribute that checks to see if this particular invokation is for a ChildAction. If it is the let the action invokation continue. If it isnt, then populate a Route Value Dictionary with the contents of all non null QueryString values and redirect to the specified Parent Action. Since the Query string is left in tact for RenderAction calls the GridAction Attribute on the Child action will create the command object correctly.
Tags
Grid
Asked by
David
Top achievements
Rank 1
Share this question
or