How to send Kendo Grid DataSourceRequest as ajax parameter

2 posts, 0 answers
  1. Adil
    Adil avatar
    26 posts
    Member since:
    Mar 2014

    Posted 28 May 2020 Link to this post

      Hi All

    Is it possible to send Kendo Grid DataSourceRequest as javascript parameter to conroller?

     

    I just want to do something like this

    var url = '../Dashboards/ExportCsvList';
    $.ajax({
        type: "POST",
        url: url,
        traditional:true,
        data: { request: datarequest} // i want to send as paramter
        success: function (msg) {
             
        }
    });

    and i want to catch that as in example below

    public FileResult ExportCsvList([DataSourceRequest]DataSourceRequest request)
    {
               //do smth...
    }

     

    Is it possible?

     

    Thanks

  2. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    1082 posts

    Posted 01 Jun 2020 Link to this post

    Hi, Adil,

    To send parameters in such way so that they are intercepted by the DataSourceRequest, use the built in ajax transport parameter map function as demonstrated in this forum thread:

    https://www.telerik.com/forums/setting-the-whole-sort-of-the-grid-from-a-single-string#Ufg9Kl_aOUGql7naDiQLKA

    Kind Regards,
    Alex Hajigeorgieva
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top