Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6595357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:55:49+00:00 2026-05-25T17:55:49+00:00

I am using the Telerik MVC Grid with Ajax binding, and am having a

  • 0

I am using the Telerik MVC Grid with Ajax binding, and am having a problem passing an object to the controller to be used to filter data. I am able to pass simple data (string, int), but not a more complex object.

For instance, I can to this no problem:

.DataBinding(dataBinding => dataBinding.Ajax().Select("_CasesAjaxBinding", "Home", new {orderId = "12345"} ))

And then in my controller, handle the orderId like this:

public ActionResult _CasesAjaxBinding(string orderId)

The problem I am having is when I try to pass a more complex object (in this case the @Model) to the controller, like this (The @Model is type CaseFilterModel):

.DataBinding(dataBinding => dataBinding.Ajax().Select("_CasesAjaxBinding", "Home", new {filterSpec = @Model} ))

And then trying to handle the object, like this:

public ActionResult _CasesAjaxBinding(CaseFilterModel filterSpec)

The filterSpec parameter is always null.

Thanks in advance for any ideas!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T17:55:49+00:00Added an answer on May 25, 2026 at 5:55 pm

    As far as I can find on the Telerik forums this cannot be done this way. There was a similar question on there, which described exactly the same problem. When passing the model it was always null in the controller’s action method.

    However there is a workaround if you want to pass multiple parameters to the select method in order to filter the data, but it requires some client side coding.

    I’ll include a summary of that work around here, so that the answer is complete. A solemn link doesn’t say much.

    Assume we have a grid which displays orders items (articles) from all the orders. First make sure to hook up the client side onDataBinding event:

    <%= Html.Telerik().Grid<Order>()
            .Name("Grid")
            .ClientEvents(events => events.OnDataBinding("onDataBinding"))
            .DataBinding(dataBinding => dataBinding.Ajax()
                                                   .Select("_AjaxBinding", "Grid"))
    %>
    

    In the client side event handler you need to compose your select URL. Here I’ll pass two parameters, an order id (int) and a description of an article (string).

    <script type="text/javascript">
    
        function onDataBinding(e) {
            var orderId = 100;
            var searchText = "test";
            var params = { OrderId: orderId, ArticleDescription: searchText };
            var paramsStr = $.param(params);
            var selectUrl = "<%= @Url.Action("_AjaxFilterBinding", "Grid") %>" 
                + "?" + paramsStr;
            var grid = $('#Grid').data('tGrid');
            grid.ajax.selectUrl = selectUrl;
        } 
    
    </script>
    

    Then in your controller you can declare the select method as follows:

    [GridAction]
    public ActionResult _AjaxFilterBinding(AjaxFilterBindingModel model)
    {
        // Retrieve data here and filter it based upon the data present in the model.
        var data = ...;
    
        return View(new GridModel<Order> { Data = data });
    }
    

    The model looks like:

    public class AjaxFilterBindingModel
    {
        public int OrderId { get; set; }
        public string ArticleDescription { get; set; }
    }
    

    Passing a collection via the URL (GET) is also possible. Let’s assume you want a collection of order IDs instead of just one.

    The model would look like this:

    public class AjaxFilterBindingModel
    {
        public IEnumerable<int> OrderIds { get; set; }
        public string ArticleDescription { get; set; }
    }
    

    And the JavaScript would look like this:

        function onDataBinding(e) {
            jQuery.ajaxSettings.traditional = true;
            var intArray = [1, 2, 3, 4, 5];
            var params = {  OrderIds: intArray, ArticleDescription: "Test" };
            var paramsStr = $.param(params);
            var selectUrl = "<%= @Url.Action("_AjaxFilterBinding", "Home") %>" + "?" 
                + paramsStr;
            var grid = $('#Grid').data('tGrid');
            grid.ajax.selectUrl = selectUrl;
        }
    

    Remark: Don’t forget to set “jQuery.ajaxSettings.traditional = true;” or the parameters will be serialized incorrectly and the ASP.NET MVC model binder will not be able to bind the integer array.

    And to be complete here is the Telerik forum thread I mentioned:

    http://www.telerik.com/community/forums/aspnet-mvc/grid/getting-the-model-object-in-a-custom-binding-grid-ajax-controller.aspx

    And the suggested work around:

    http://www.telerik.com/community/forums/aspnet-mvc/grid/code-sample-sending-additional-filters-with-ajax-binding.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the Telerik MVC grid, with Ajax data binding. I would like
I am using the Telerik MVC grid, together with AJAX binding to actions secured
I'm using telerik mvc grid and bound my columns throuugh Data Table, I having
I am using Ajax binding with the Grid and ran into a problem where
Using telerik mvc grid with ajax, give me some headaches. I am trying to
First some background..I am using the Telerik MVC Grid to display data. The grid
The Telerik MVC grid I am using is shown below. The data is displaying
I'm used to using Telerik Grids and I'm able to display them in an
We're using the Telerik Rad Controls for ASP.Net Ajax on an ASP.Net MVC project.
I'm using the Telerik MVC Grid component to render a groupable grid populated via

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.