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

Getting generated query from Kendo UI Grid MVC

1 Answer 110 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 17 May 2013, 06:06 PM
Hello,

Is there a way to get the generated query from the Kendo UI Grid? I would like to get this query that has anything the user selected such as sorting, grouping, filtering, ordering, etc.

What I'm trying to do is have a business layer do validation first to see if the query can be performed. Then if it passes with the search criteria let the query that was generated by the grid perform the search.

I'm using Entity framework so it would be nice if there is a way to get the query or linq generated without trying to scrape the DataSourceRequest object.

Thank you,

Daniel

1 Answer, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 21 May 2013, 02:20 PM
Hi Daniel,

 
I would suggest to use the DataSourceRequest object and get the search / filter / paging from it to perform the custom check. Then if the check passes you can return the data to the client side by passing the request object to the ToDataSourceResult extension method.

Also please note that we are using custom model binder to be able to bind the data from the request on the server side - you can create another custom model binder to bind the request parameters to custom request object. 

Kind Regards,
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Daniel
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Share this question
or