Hello,
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 client...at 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}} ?
Thanks
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 client...at 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}} ?
Thanks