I seem to have hit an issue with paging after upgrading to the latest version of kendo.
It happens with ajax and server binding. It appears that the filter data for the data source passes undefined values, which results in a 500 error on the server when it tries to bind to the filter values. If I apply a filter, paging starts to work again.
(server binding example)
Grid Code
@(Html.Kendo()
.Grid(Model.Items)
.Name("operatorList")
.DataSource(ds => ds.Server())
.Columns(columns =>
{
columns.Bound(c => c.Name);
})
.Filterable()
.Pageable())
Action
public ActionResult Index()
{
var vm = new LookUpIndexViewModel<T>();
vm.Recent = GetRecentlyActive();
vm.Items = All();
return View(vm);
}
Url Requested (when paging)
http://localhost/browse/operator?operatorList-sort=&operatorList-page=2&operatorList-pageSize=15&operatorList-group=&operatorList-filter=undefined~undefined~undefined
Scripts Included (in this order)
<script src="/scripts/kendo.all.js"></script>
<script src="/scripts/kendo.aspnetmvc.js"></script>
doulbe checked versions also both say: v2013.2.716
Stack Trace
[NullReferenceException: Object reference not set to an instance of an object.]
Kendo.Mvc.Infrastructure.Implementation.FilterNodeVisitor.Visit(PropertyNode propertyNode) +60
Kendo.Mvc.UI.DataSourceRequestModelBinder.BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) +465
Kendo.Mvc.UI.Grid`1.ProcessDataSource() +395
Kendo.Mvc.UI.Grid`1.WriteHtml(HtmlTextWriter writer) +1145
Kendo.Mvc.UI.WidgetBase.ToHtmlString() +105
Kendo.Mvc.UI.Fluent.WidgetBuilderBase`2.ToHtmlString() +19
System.Web.WebPages.WebPageExecutingBase.WriteTo(TextWriter writer, Object content) +57
CtrlDev.Wdb.Web.Areas.Browse.Views.Operator.Index.Execute() in f:\Projects\CtrlDev.WDB\CtrlDev.Wdb.Web\Areas\Browse\areas\browse\views\operator\Index.cshtml:26
System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +279
System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +124
System.Web.WebPages.StartPage.ExecutePageHierarchy() +142
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +103
RazorGenerator.Mvc.PrecompiledMvcView.Render(ViewContext viewContext, TextWriter writer) +951
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +377
System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +32
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +263
System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +236
System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +28
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +42
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +42
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +1725
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +560
Found this question on SO, not sure if it is related, but it sounds like it.
Any help would be greatly appreciated!
Thanks!
Josh
It happens with ajax and server binding. It appears that the filter data for the data source passes undefined values, which results in a 500 error on the server when it tries to bind to the filter values. If I apply a filter, paging starts to work again.
(server binding example)
Grid Code
@(Html.Kendo()
.Grid(Model.Items)
.Name("operatorList")
.DataSource(ds => ds.Server())
.Columns(columns =>
{
columns.Bound(c => c.Name);
})
.Filterable()
.Pageable())
Action
public ActionResult Index()
{
var vm = new LookUpIndexViewModel<T>();
vm.Recent = GetRecentlyActive();
vm.Items = All();
return View(vm);
}
Url Requested (when paging)
http://localhost/browse/operator?operatorList-sort=&operatorList-page=2&operatorList-pageSize=15&operatorList-group=&operatorList-filter=undefined~undefined~undefined
Scripts Included (in this order)
<script src="/scripts/kendo.all.js"></script>
<script src="/scripts/kendo.aspnetmvc.js"></script>
doulbe checked versions also both say: v2013.2.716
Stack Trace
[NullReferenceException: Object reference not set to an instance of an object.]
Kendo.Mvc.Infrastructure.Implementation.FilterNodeVisitor.Visit(PropertyNode propertyNode) +60
Kendo.Mvc.UI.DataSourceRequestModelBinder.BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) +465
Kendo.Mvc.UI.Grid`1.ProcessDataSource() +395
Kendo.Mvc.UI.Grid`1.WriteHtml(HtmlTextWriter writer) +1145
Kendo.Mvc.UI.WidgetBase.ToHtmlString() +105
Kendo.Mvc.UI.Fluent.WidgetBuilderBase`2.ToHtmlString() +19
System.Web.WebPages.WebPageExecutingBase.WriteTo(TextWriter writer, Object content) +57
CtrlDev.Wdb.Web.Areas.Browse.Views.Operator.Index.Execute() in f:\Projects\CtrlDev.WDB\CtrlDev.Wdb.Web\Areas\Browse\areas\browse\views\operator\Index.cshtml:26
System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +279
System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +124
System.Web.WebPages.StartPage.ExecutePageHierarchy() +142
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +103
RazorGenerator.Mvc.PrecompiledMvcView.Render(ViewContext viewContext, TextWriter writer) +951
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +377
System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +32
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +263
System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +236
System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +28
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +42
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +42
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +1725
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +560
Found this question on SO, not sure if it is related, but it sounds like it.
Any help would be greatly appreciated!
Thanks!
Josh