If you change the dataSource to a grid (for example by changing the filter conditions) so that less data is returned, you will not be warned if the current page is no longer valid. No error is reported and no data is returned and you won't have a clue why. Try this to replicate: Make a paged grid plus a couple of datepickers to filter the grid data by date range. Add a button to make the new filter dates effective. Write a new MVC controller method to populate the data, using the ToDataSourceResult extension method e.g. "return Json(obj.ToDataSourceResult(request));" to return data. Open a sizeable dataset in the grid (many pages) and go to the last page. Change the filter conditions to be much more restrictive. Click the button to make them effective. Watch as the grid displays no data, the code reports no error and stepping into your controller confirms that the method is returning data. Confusing huh? An error or warning would make this much clearer.
The existing solution was built in 2009 using .Net 3.5 web forms framework (List View), ASP.Net Ajax (Accordion) and JQuery (validation). The web page accomplishes the following key functional requirements – a. Ability to group products – The groups are dynamically extracted from the same datasource that is providing the product list. Using ASP.Net Ajax we were able to provide the expand / collapse visual effect. b. Ability to enter order quantities very quickly - a lot of stores place orders at the last minute (5-10 minutes before order deadline) for valid reasons. The web page readily provides a text box for quick entry. On a desktop, the user can traverse the rows within the group using the tab key. The web page typically contains 150 – 200 products for entry. Having to click on Edit/Update/Cancel dramatically increases the number of clicks / touch / swipe. Besides, it creates a real estate issue on smaller form factors. c. Real time validation – using JQuery we were able to validate the row as and when the quantity was entered. Any error would show below the row in question. The error would continue to show until the quantity was revised. The error however, will not stop the user from entering quantities on other rows. This approach lets the user review any errors in the end.
Static property requires null instance, non-static property requires non-null instance. Parameter name: expression Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: Static property requires null instance, non-static property requires non-null instance. Parameter name: expression [ArgumentException: Static property requires null instance, non-static property requires non-null instance. Parameter name: expression] System.Linq.Expressions.Expression.Property(Expression expression, PropertyInfo property) +4376691 System.Linq.Expressions.Expression.MakeMemberAccess(Expression expression, MemberInfo member) +90 Kendo.Mvc.Infrastructure.Implementation.Expressions.MemberAccessTokenExtensions.CreateMemberAccessExpression(IMemberAccessToken token, Expression instance) +122 Kendo.Mvc.Infrastructure.Implementation.Expressions.ExpressionFactory.MakeMemberAccess(Expression instance, String memberName) +107 Kendo.Mvc.Infrastructure.Implementation.Expressions.PropertyAccessExpressionBuilder.CreateMemberAccessExpression() +70 Kendo.Mvc.Infrastructure.Implementation.Expressions.MemberAccessExpressionBuilderBase.CreateLambdaExpression() +17 Kendo.Mvc.Infrastructure.Implementation.SortDescriptorCollectionExpressionBuilder.Sort() +120 Kendo.Mvc.Extensions.QueryableExtensions.CreateDataSourceResult(IQueryable queryable, DataSourceRequest request, ModelStateDictionary modelState, Func`2 selector) +888 Kendo.Mvc.Extensions.QueryableExtensions.ToDataSourceResult(IQueryable`1 enumerable, DataSourceRequest request, Func`2 selector) +58
ToDataSourceResult is very very slow on Large datasets - getting the Total Count is the issue, have an option to omit the total count or provide a way to inject the total count with some more efficient code.