Json model binder for DataSourceRequest

3 posts, 0 answers
  1. Henry
    Henry avatar
    16 posts
    Member since:
    Feb 2014

    Posted 24 May 2016 Link to this post


    I'm trying to pass in DataSourceRequest instance to a web api method (POST), and can't find the model binder for it.

    Here's my scenario in short:

    1) Kendo Grid uses MVC controller action to get the data, and DataSourceRequest is binded ok.

    2) In turn, the MVC action needs to call a web api url (using post), and include the DataSourceRequest as content (json format)


    I checked this article: http://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/web-api-server-operations

    But it only discusses the GET request, and when grid is directly calling web api.


    Is there a json model binder for DataSourceRequest, for web api?

  2. Henry
    Henry avatar
    16 posts
    Member since:
    Feb 2014

    Posted 25 May 2016 Link to this post

    FYI, I was able to do this with a custom model binder (using Json.net serialize / deserialize).

    Still, would be nice to know if there's an 'official' way to do it?

  3. Vladimir Iliev
    Vladimir Iliev avatar
    2190 posts

    Posted 26 May 2016 Link to this post

    Hello Henry,

    There is no build-in way to do this and you should use custom code to achieve the desired behavior (as you already did).

    Vladimir Iliev
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top