Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 99250

Using DataSourceResult with Kendo UI Grid

$
0
0

I'm attempting to use the Kendo UI DataSourceResult with my Kendo UI Grid using the code found here.

I'm not using ASP.NET MVC, but rather VB.NET with ASP.NET Web Forms and Web API on the backend. I understand how the DataSourceResult object works, however I'm having trouble figuring out the lines of code at lines 19-21. Here is the code in C#:

DataSourceRequest request = JsonConvert.DeserializeObject<DataSourceRequest>(
// The request is in the format GET api/products?{take:10,skip:0} and ParseQueryString treats it as a key without value
requestMessage.RequestUri.ParseQueryString().GetKey(0));

and the code equivalent in VB.NET:

' The request is in the format GET api/products?{take:10,skip:0} and ParseQueryString treats it as a key without value
Dimrequest AsDataSourceRequest = JsonConvert.DeserializeObject(Of DataSourceRequest)(requestMessage.RequestUri.ParseQueryString().GetKey(0))

Whenever I execute the code I get a System.ArgumentOutOfRangeException. Debugging the code the requestMessage.RequestUri.ParseQueryString().GetKey(0) returns "take" which is what I'd expect, as that's the key of the first parameter. Using Fiddle I can see that the Grid sends the RequestUri of "http://localhost:53786/api/object/4?take=20&skip=0&page=1&pageSize=20". What do I need to do to get the code working correctly with my Grid and API?


Viewing all articles
Browse latest Browse all 99250

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>