Passing additional info when binding grid

2 posts, 0 answers
  1. Michele
    Michele avatar
    426 posts
    Member since:
    Jun 2009

    Posted 03 Sep 2013 Link to this post

    I'm using KENDO UI grid in mvc4 application and following your tutorial for ajax binding I'm doing something  as

    public ActionResult Products_Read([DataSourceRequest]DataSourceRequest request)
    using (var northwind = new NorthwindEntities())
    IQueryable<Product> products = northwind.Products;
    // Convert the Product entities to ProductViewModel instances
    DataSourceResult result = products.ToDataSourceResult(request, product => new ProductViewModel
    ProductID = product.ProductID,
    ProductName = product.ProductName,
    UnitsInStock = product.UnitsInStock
    return Json(result);

    Now I need to add an export in PDF/csv function... I was wondering since you don't offer it out of the box to store a guid of the retieved data and pass it back to
    the the button click I'll pass this data back to the server and export the data if still present in cache otherwist I'll remake the call...
    now I've tried adding a TempData["guid"] just before the Json(result) but with no luck.. should I change the binding method? and use a pure kendoui grid passing back an object as
    Result { Guid ID {get;set; } IEnumerable<type> DataItems {get;set}} ?

  2. Petur Subev
    Petur Subev avatar
    1882 posts

    Posted 04 Sep 2013 Link to this post

    Hello Paolo,

    I am not sure what exactly is the question.  Can you please elaborate?

    Basically exporting to pdf, csv is covered in the code library:

    How to send additional parameters to the server is covered here:

    Kind Regards,
    Petur Subev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top