This is a migrated thread and some comments may be shown as answers.

IQueryable fails with Ajax DataSource but works with Server

2 Answers 134 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Masoud
Top achievements
Rank 1
Masoud asked on 23 May 2013, 03:56 PM
Hi,
I am using MVC Kendo (2013.1.319.340) with MVC 4 under dot.net 4.5.  LLBLGen is the O/R Mapper in version 3.5.  LLBLGen Pro to Linq is used (not EF or LinqToSQL). 

Binding a Kendo MVC Grid using Server Binding, sort/filter/group/page work fine.  Controller code is as follows:
public ActionResult Index()
{
    LinqMetaData metaData = new LinqMetaData(_adapter);
    return View(metaData.Mandant);
}
metaData.Mandant returns an IQueryable provided by LLBLGen.

When I try the same access using Ajax Binding, only Paging information is transformed properly to the IQueryable provider.  Controller code is
public ActionResult Query(DataSourceRequest request)
{
return Json(_db.GetMandant().ToDataSourceResult(request, entity => new
{
entity.AktualisiertAm,
entity.AktualisiertVon
}), JsonRequestBehavior.AllowGet);
}
Here only paging information is actually applied in the query emitted by LLBLGen.  Filter/Sort/Group settings are not being applied to the query at hand. 
Here is an older thread that seems to point to a similar issue (http://www.telerik.com/community/forums/aspnet-mvc/grid/sorting-with-llblgen-linqmetadata.aspx).  The lnk to the solution suggested (http://www.telerik.com/community/forums/aspnet-mvc/general/datetime-sorting-problem.aspx) is no longer valid.

Thank you for your help on this isse!



2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 24 May 2013, 06:43 AM
Hello,

 You have probably forgotten to include kendo.aspnetmvc.min.js.

Regards,
Atanas Korchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Accepted
Masoud
Top achievements
Rank 1
answered on 24 May 2013, 11:48 AM
Hi Atanas!

The binding of the scripts was ok.  The issue was the missing binding attribute for DataSourceRequest
public ActionResult Query(DataSourceRequest request)
vs.
public ActionResult Query([DataSourceRequest]DataSourceRequest request)
Thank you for your help.
Tags
Grid
Asked by
Masoud
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Masoud
Top achievements
Rank 1
Share this question
or