0

We are using KendoGrid in our ASP.NET MVC application. We have written custom filters to allow users to filter grid based on wide-range of selection options. The grid is filtered when invoked following call from a user event:

gridData.dataSource.query({ page: pageNo, pageSize: pageSize, sort: sort, filter: filterData });

Here, gridData holds instance of the KendoGrid.

This works properly in all cases, but it is failing in one specific case where the the filter property has more than 12,25,000+ characters.

I am getting an error saying "System.StackOverflowException occurred in Kendo.Mvc.dll". While monitoring the request in developer tools, I can see the Ajax request to "CustomAction" is taking place and is having proper value in "filter" property even though it is too large string. However, it is not being accepted by the MVC action which is bound as a data source of KendoGrid. Following is the signature of the MVC action that performs filtering of data for KendoGrid -

public ActionResult CustomAction([DataSourceRequest] DataSourceRequest request)

Any help on this would be much appreciated.

Thanks

Nirman
  • 6,715
  • 19
  • 72
  • 139
  • It could be that ASP.NET is not allowing requests that big. Try changing [maxRequestLength](https://stackoverflow.com/a/288675/2091230) in your web config. – Justinas Marozas Jan 23 '18 at 11:18
  • I have tried setting it to maximum (i.e., - 2147483647), and still receiving the same error. – Nirman Jan 23 '18 at 11:42
  • The request must be coming through as that extension method is picking up on the request and bombing. Why 12,25,000 expression in your filter, how could anyone type that many conditions? Anyway, could you remove the [DataSourceRequest] DataSourceRequest request formal parameter and let the data pass in with out hitting the server wrappers. To see if the request will pass through. – Ross Bush Jan 23 '18 at 15:19
  • yes, I agree the amount of data is too high, and is not ideal. But there was a lot of debate around fixing that, but that would involve rewriting of in-production code and which is not feasible considering the timeframe. So I was thinking if there is some configuration that would resolve this issue? – Nirman Jan 24 '18 at 06:05
  • I tried removing "DataSourceRequest" parameter, and after that I could see the request getting hit the controller action. Do you know any configuration at Kendo level to increase the content length? – Nirman Jan 24 '18 at 06:06

0 Answers0