We're dealing with a strange error that appears to be a race condition while the kendo menu is checking permissions to "trim" the menu items. The error message we've logged is: System.IndexOutOfRangeExceptionIndex was outside the bounds of the array (see stack trace below).
This seems to be a race condition as it happens infrequently, and apparently only at times of heavy use. We also can't reproduce it in any of our test or development environments; we see it logged only in production.
I've downloaded the kendo source bundle, but it (rather surprisingly) doesn't contain any C# code! So we can't actually get any insight into what might be causing this error to be thrown by the MVC menu wrapper.
My guess is that the kendo menu is parallelizing the requests to check action authorization, and in rare cases this causes a race condition on the collection access (again, see stack trace) which is not thread-safe.
Can you provide any guidance on this issue?
Thanks!
Stack Trace:
System.Web.HttpException (0x80004005): Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'. ---> System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.Collections.ArrayList.Add(Object value)
at Kendo.Mvc.Infrastructure.Implementation.ControllerAuthorization.IsAccessibleToUser(RequestContext requestContext, String controllerName, String actionName, RouteValueDictionary routeValues)
at Kendo.Mvc.Infrastructure.Implementation.NavigationItemAuthorization.IsAccessibleToUser(RequestContext requestContext, INavigatable navigationItem)
at Kendo.Mvc.UI.NavigationItemContainerExtensions.WriteItem[TComponent,TItem](TItem item, TComponent component, IHtmlNode parentTag, INavigationComponentHtmlBuilder`1 builder)
at Kendo.Mvc.UI.NavigationItemContainerExtensions.<>c__DisplayClass5`2.<WriteItem>b__1(TItem child)
at Kendo.Mvc.Extensions.EnumerableExtensions.Each[T](IEnumerable`1 instance, Action`1 action)
at Kendo.Mvc.UI.NavigationItemContainerExtensions.WriteItem[TComponent,TItem](TItem item, TComponent component, IHtmlNode parentTag, INavigationComponentHtmlBuilder`1 builder)
at Kendo.Mvc.UI.Menu.<>c__DisplayClass1.<WriteHtml>b__0(MenuItem item)
at Kendo.Mvc.Extensions.EnumerableExtensions.Each[T](IEnumerable`1 instance, Action`1 action)
at Kendo.Mvc.UI.Menu.WriteHtml(HtmlTextWriter writer)
at Kendo.Mvc.UI.WidgetBase.ToHtmlString()
at Kendo.Mvc.UI.Fluent.WidgetBuilderBase`2.ToHtmlString()
at System.Web.WebPages.WebPageBase.Write(Object value)
at ASP._Page_Views_Menu_Application_cshtml.Execute() in d:\WWWRoot\SASB\Views\Menu\Application.cshtml:line 14
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.<>c__DisplayClass4.<Wrap>b__3()
at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func`1 func)
at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage)
at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm)
at System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter)
at System.Web.Mvc.Html.ChildActionExtensions.Action(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues)
at ASP._Page_Views_Shared__ApplicationLayout_cshtml.Execute() in d:\WWWRoot\SASB\Views\Shared\_ApplicationLayout.cshtml:line 9
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at System.Web.WebPages.WebPageBase.<>c__DisplayClass3.<RenderPageCore>b__2(TextWriter writer)
at System.Web.WebPages.WebPageBase.Write(HelperResult result)
at System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body)
at System.Web.WebPages.WebPageBase.PopContext()
at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)
@(Html.Kendo().Upload() .Name("Attachments").Multiple(true).ShowFileList(true) .Async(async => async .Save("Attach", "Controller", new { entryId = Model.Id }) .Remove("RemoveAttachment", "Controller", new { entryId = Model.Id })) .Files(files => { if (Model.Attachments != null) { foreach (var f in Model.Attachments) { files.Add().Name(f); } } }))Hi, I'm trying to use server-side wrappers of the UI Spreadsheet for ASP.NET MVC. I've looked over the documentation and searched this forum, and I can't find the answer to this question: is it possible to bind the spreadsheet data to a model passed to a view, in the same manner as it's done for the Grid control? For example, like the below.
Thank you!
example below;
@(Html.Kendo().Grid(Model) //Bind the Grid to the Model property of the view.
.Name("Grid")
.Columns(columns =>
{
columns.Bound(p => p.ProductID); //Create a column bound to the "ProductID" property
columns.Bound(p => p.ProductName); //Create a column bound to the "ProductName" property
columns.Bound(p => p.UnitPrice); //Create a column bound to the "UnitPrice" property
columns.Bound(p => p.UnitsInStock);//Create a column bound to the "UnitsInStock" property
})
.Pageable() //Enable paging.
)
Hello Telerik,
We are using kendo controls for over the past 5 years, and we have recently noticed a bug with the hierarchy grid's child's which contain date columns and filters. We always initialize detail grids on detailnit of master grid, by passing the data which is rendered as a list from master model.
So, to give you an example. Imagine we have a master grid defined like below :
01.@(Html.AthenaParameterConfigGrid<StudentItineraryResult>()02. .Name("studentItinerary")03. .Columns(columns =>04. { 05. columns.Bound(e => e.Person.Id).Hidden();06.08. columns.Bound(e => e.Person.FathersName).Width(200);09. columns.Bound(e => e.Person.MothersName).Width(200);10. columns.Bound(e => e.Person.Email).Width(200);11. 2324. })25. .Scrollable(s => s.Enabled(true).Height("auto"))26. .Sortable()27. .Groupable(gr => gr.Enabled(false))28. .HtmlAttributes(new { @class = "hide-vertical-scrollbar atn-tabstrip-grid atn-grid-dropdown-menu" })29. .ClientDetailTemplateId("itineraries")30. .AutoBind(false)31. .DataSource(dataSource => dataSource32. .Ajax()33. .PageSize(10)34. .ServerOperation(false)35. .Model(model => model.Id(p => p.StudentId))36. .Read(read => read.Action("StudentItinerariesSearch", "Student").Data("athena.studentItineraries.searchRequestData"))37. .Events(events => events38. .Error("athena.utilities.onErrorSearch").RequestEnd("athena.utilities.laddaStop")39. )40. )41. .Events(events => events.DetailInit("athena.studentItineraries.detailInit"))42. .Deferred())
And a detail template grid initialized again server side with no datasource read options configured, where BusStopArrivalTime and AtttendeeEventDate(and other fields that we dont show in this case) are proper DateTime fields.<script id="itineraries" type="text/kendo-tmpl"> @(Html.Kendo().TabStrip() .Name("tabStrip_#=StudentId#") .SelectedIndex(0) .Animation(animation => animation.Open(open => open.Fade(FadeDirection.In))) .Items(items => { items.Add().Text(@Html.GetResource(common, "TabStripBasic")).Content(@<text> @(Html.AthenaParameterConfigGrid<StudentItineraryFlat>() .Name("grid_#=StudentId#") .Columns(columns => { columns.Bound(o => o.BusStopLabel).Hidden(); columns.Bound(o => o.BusRouteLabel).Width(250); columns.Bound(o => o.BusStopName).Width(100); columns.Bound(o => o.AttendeeStatusUserString).Width(80); // TODO : filtering here does not want to work... columns.Bound(o => o.BusStopArrivalTime).Width(80).ClientTemplate("\\#= BusStopArrivalTime !=null ? kendo.toString(kendo.parseDate(BusStopArrivalTime), 't') : '' \\#").Filterable(filterable => filterable.UI(GridFilterUIRole.TimePicker)); // TODO : filtering here does not want to work... columns.Bound(o => o.AttendeeEventDate).Width(80).ClientTemplate("\\#= AttendeeEventDate !=null ? kendo.toString(kendo.parseDate(AttendeeEventDate), 'd') : '' \\#").Filterable(filterable => filterable.UI(GridFilterUIRole.DatePicker)); columns.Bound(o => o.AttendeeCronLabel).Width(100); columns.Bound(o => o.AttendeeComment).Width(150); columns.Bound(o => o.ProfileOuSpecialtySemesterLabel).Width(200); }) .AutoBind(false) .DataSource(dataSource => dataSource .Ajax() .PageSize(5) .ServerOperation(false) .Model(model => { model.Id(c => c.AttendeeId); }) ) .Events(ev => ev.DataBinding("athena.studentItineraries.childDataBinding").DataBound("athena.studentItineraries.childDataBound")) .Sortable(x => x.Enabled(true)) .Filterable(x => x.Enabled(true)) .Pageable(pgb => pgb.Enabled(false)) .Groupable(gr => gr.Enabled(false)) .ToClientTemplate()) </text> ); }).Deferred() .ToClientTemplate() ) </script>
So, in the detailInit of the master grid, we take the data from sender event(master grid), and we fill child's grid dataSource.data with this list of data like below:
function detailInit(e) { var grid = $("#grid_" + e.data.StudentId).data("kendoGrid"); if (e.data.HasAttendee) { // feed child grid with master data; grid.dataSource.data(e.data.ItinerariesFlattened.toJSON()); } }
So the problem here is, that our datetime fields as described above, are not working. After a bit research, i found that e.data.ItinerariesFlattened or e.data.ItinerariesFlattened.toJSON(), if i log the data to console i have an object like this
....//other string fieldsBusRouteEndDate: "/Date(1561237200000)/",BusRouteStartDate: "/Date(1538341200000)/"BusStopArrivalTime: "/Date(1554784800000)/"...//other string fields herefunction detailInit(e) { var grid = $("#grid_" + e.data.StudentId).data("kendoGrid"); if (e.data.HasAttendee) { // feed child grid with master data; var parsedData = e.data.ItinerariesFlattened.map( attendee => { var model = attendee || {}; model.AttendeeEventDate = w.kendo.parseDate(attendee.AttendeeEventDate); model.BusStopArrivalTime = w.kendo.parseDate(attendee.BusStopArrivalTime); return model; } ); grid.dataSource.data(parsedData); } }Hello, I'm having troubles after update with the pagination controls in the grids.
The "k-pager-nav" controls are getting duplicated and the buttons to the right and to the left of the pagination numbers are blocked. The ones that works are the second button group.
Here is an image of the grid pagination with the duplicated controls.
Thank you!
I have a listBox that I can manually sort using the toolbar buttons. The ListBox is in a form, so when I submit a form, the items in that list box get submitted as an int array. However, regardless of how I sort the ListBox, the array of items is always in the same order. I assume that, as there is functionality to interactively sort a list box, there is a method to get that sequence out. I can't find an example of how this might be achieved in the context of a listbox in a form. Could you provide some pointers? Thanks.
Ian Parsons.
I'm trying to set up a MultiSelectFor to be used NoDataTemplate, but the pop-up just never seems to appear. There is an HTML5 version on the site,but not one for MVC: http://demos.telerik.com/kendo-ui/multiselect/addnewitem
Here is what I have wrriten, but the template never appears
<script id="@noDataTemplateID" type="text/x-kendo-tmpl"> <div> No data found. Do you want to add new item - '#: instance.input.val() #' ? </div> <br /> <button class="k-button" onclick="addNew('#: instance.element[0].id #', '#: instance.input.val() #')">Add new item</button></script><script> //the actual data won't get synced to the server, but that's okay because when we save this new item on the update of the parent model, we presumably will grab that newly added item on the next read function addNew(widgetId, value) { var widget = $("#" + widgetId).getKendoMultiSelect(); var dataSource = widget.dataSource; if (confirm("Are you sure?")) { dataSource.add({ ProductID: 0, ProductName: value }); dataSource.one("requestEnd", function (args) { if (args.type !== "create") { return; } var newValue = args.response[0].ProductID; dataSource.one("sync", function () { widget.value(widget.value().concat([newValue])); }); }); dataSource.sync(); } }</script>@( Html.Kendo().MultiSelectFor(m => m) .DataTextField(descriptionField) .DataValueField(IDFIeld) .NoDataTemplate(noDataTemplateID) .DataSource(source => { source.Read(read => { read.Action("Read", "List", new { ListType = ListType, Param1 = Param1, Param2 = Param2, Param3 = Param3 }); }) .ServerFiltering(true); }))

Anyone know why I'm getting a javascript error saying: "Kendo file / is included more than once"? Sometimes it doesn't show this error, but most of the time it does. Below is my layout.cshtml. Any help would be greatly appreciated!
<!DOCTYPE html>
<html>
<head>
<title>@ViewBag.Title</title>
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2017.1.223/kendo.common.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2017.1.223/kendo.dataviz.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2017.1.223/kendo.default.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2017.1.223/kendo.dataviz.default.min.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/kendo/2017.1.223/jquery.min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo/2017.1.223/jszip.min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo/2017.1.223/kendo.all.min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo/2017.1.223/kendo.aspnetmvc.min.js")"></script>
@RenderSection("HeadContent", false)
@*using the bundles instead*@
@*@Styles.Render("~/Content/test.css")*@
@Scripts.Render("~/bundles/bootstrap")
@Styles.Render("~/Content/css")
<script src="@Url.Content("~/Scripts/kendo.modernizr.custom.js")"></script>
</head>
<body>
<header>
</header>
<div id="body">
@RenderSection("featured", required: false)
<section class="content-wrapper main-content clear-fix">
@RenderBody()
</section>
</div>
<footer>
<div class="content-wrapper">
</div>
</footer>
</body>
</html>
<!--Reference the SignalR library. (after jquery references)-->
<script src="~/Scripts/jquery.signalR-2.2.0.min.js"></script>
<!--Reference the autogenerated SignalR hub script. -->
<script src="~/signalr/hubs"></script>

Hi,
I'm evaluating the grid with the trial version to see if your solution fits into our web application.
I'm trying to adapt the grid in our web asp.net MVC and I've encountered a problem with the filters date.
We need to enter "> = 1.1.2018" or "1.1.2018#31/12/2018" and it reaches FileDescriptor request as a value. With this i build the query to launch the SQL server.
Now no Filters arrive to request from ajax "Consulta_Viajes"
@(Html.Kendo().Grid<ViewModels.ViajesViewModel>() .Name("grid") .EnableCustomBinding(true) .Columns(columns => {columns.Bound(c => c.itdavia).Hidden(); columns.Bound(c => c.ctdavia).Title(LocalizationResources.Strings.viaje); columns.Bound(c => c.ctrnest).Title(LocalizationResources.Strings.codigo_estado); columns.Bound(c => c.dtrnest).Title(LocalizationResources.Strings.estado); columns.Bound(c => c.ftdavia).Title(LocalizationResources.Strings.fecha_viaje).Groupable(false).Format("{0:dd/MM/yyyy}").Width(150); columns.Bound(c => c.htdavia).Title(LocalizationResources.Strings.hora_viaje).Groupable(false).Format("{0:HH:mm}"); columns.Bound(c => c.cdvn).Title(LocalizationResources.Strings.codigo_division); }) .Scrollable() .Groupable() .Sortable() .Filterable(ftb => ftb.Mode(GridFilterMode.Row) .Extra(false)) .Pageable() .Resizable(resize => resize.Columns(true)) .Reorderable(reorder => reorder.Columns(true)) .DataSource(dataSource => dataSource .Ajax() .Read("Consulta_Viajes", "AsignacionMensajero", new { strTabla = "tdavia" }) .ServerOperation(true) ) .Deferred(true) .AutoBind(false))
How can I do this?
Thanks in advance.
Regards.

Hi,
In our app we have a js frunction to prevent the autocomplete of inputs and textboxes:
function autoCompleteOff() { $(':text, form').attr('autocomplete', 'nope'); }The function it's loaded when the app starts so that be executed in every form we have.
The problem that we have is that when we open a kendo window the function it's not working and the text boxes show possible options to select.
We would like know how to load this function and prevent these suggestions.
We could add a call in each window but it does not seem like the best option. We believe that it should be defined only once. Any idea how to fix it?
Thanks in advance.
