I have a grid with a large dataset that I want to limit by querying data in pages. The Stored Procedure works fine in the paging process. If I do not set the DataSourceResult.Total value the grid does not allow the user to click the ">" icon in the paging section, as if it sees no records.
If I do set the total to how many records actually exist (9000 in this scenario) the grid comes up with no records.
Here are the lines before the Read() method returns ..
1) IQueryable<ROHS> res = viewModel.Data.AsQueryable<ROHS>();
2) DataSourceResult data = res.ToDataSourceResult(request);
3) return Json(data);
I can see in the debugger that res.Results View (1) shows the 100 records.
As soon as (2) happens the "Data" member of the DatasourceResult object has not records.
Can someone point out what I am doing wrong here?
Thanks
5 Answers, 1 is accepted
Thank you for the provided code.
I have investigated it and I did not notice anything that might cause an issue. The ToDataSourceResult extension method will page, filter, sort, or group your data using the information provided by the DataSourceRequest object. I assume that the issue might be caused due to а invalid DataSourceRequest parameter.
Could you please make sure that the page and pageSize properties of the DataSourceRequest parameter have values?
Having said that, sharing a demo that clearly replicates the issue would definitely help us fully understand the case and we will be able to provide further assistance to the best of our knowledge.
I look forward to your reply.
Regards,
Georgi
Progress Telerik
I would recommend you to take a look at the following article which explains how to configure the action method for server operations step by step:
Furthermore, we have a demo which demonstrates server operations:
Having said that, sharing a demo that clearly replicates the issue would definitely help us fully understand the case and we will be able to provide further assistance to the best of our knowledge.
Regards,
Georgi
Progress Telerik