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

[Solved] How to bind an ajax grid with parameters?

1 Answer 93 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
Top achievements
Rank 1
Julien asked on 30 Jan 2012, 11:46 AM
Hi,

I'm integrating a grid into a page, but I've one little problem.

This page list items of a specified "category".

So I receive an "Id" as parameter of my controler.

No problem here, I can load it without problem, but how to configure the ajax request to make its request to 

/MyController/MyAction/The_id_of_the_Current_page ?

My code is actually:
@{Html.Telerik().Grid<IEnumerable<Infoteam.RsSolutions.AdManager.Common.Data.DataModel.Ad>>()
                .Name("AdsGrid")
                .DataBinding(db => db.Ajax().Select("_AdsPaging", "Ads"))
                .Pageable()
                .Scrollable()
                .Render();              
                }

How to add the "id" part?

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 30 Jan 2012, 03:09 PM
Hi Julien,

Basically you can use the overload which adds a route value.
e.g.

.DataBinding(db => db.Ajax().Select("_AdsPaging", "Ads",new {id=yourIdHere}))
Regards,
Petur Subev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
Grid
Asked by
Julien
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or