or
ModelState.AddModelError(Item.Id, "this value is outside of the valid range");01.function error_handler(e) {02. var data = e.sender._data;03. if (e.errors) {04. $.each(e.errors, function (key, value) {05. highlightError(data, key, value);06. });07. }08.}09. 10.function highlightError(data, key, value) {11. var grid = GetGrid("grid");12. for (var i = 0; i < data.length; i++) {13. var row = data[i];14. 15. if (row.id == key) {16. var hasError = $('[data-uid="' + row.uid + '"]');17. hasError.addClass('kendo-error-row'); //this seems to be working, but it doesn't survive the whole process.18. hasError[0].mouseover = function () { alert(errors[error].value); };19. }20. }21.}
<div data-role="splitview"> <div data-role="pane" id="left-pane" data-layout="side-default" data-transition="slide"> <div data-role="layout" data-id="side-default" data-show="toggleBackButton"> <!-- my layout stuff's in here --> </div> <div data-role="view" id="lp_index" data-title="Smith & Co"> <!-- view stuff in here --> </div> </div> <div data-role="pane" id="right-pane" data-layout="main-default" data-navigate="onNavigate"> <div data-role="layout" data-id="main-default"> <!-- layout stuff --> </div> <div data-role="view" > <!-- view stuff here --> </div> </div></div><script> var app = new kendo.mobile.Application(document.body); function onNavigate(e) { alert($("#right-pane").data("kendoMobilePane").view()); }</script><script type="text/x-kendo-tmpl" id="FilterByTypeItemTemplate"> <li><a href="\##:Name #" ng-click="FilterByType('#:Name #')"><i class="icon-chevron-right pull-right"></i><em class="pull-right">(#:Count #)</em> #:Name # </a></li></script><div id="ItemContainer0" class="textItem ui-draggable" data-bind="style: {height: Height + 10 + 'px', width: Width + 10 + 'px', top: Y - 6 + 'px', left: X - 6 + 'px', 'z-index': Z}" index="0" style="height: 60px; width: 210px; top: 77px; left: 135px;">$("#user-Search").kendoDropDownList({ autobind: false, enabled: true, optionLabel: "All", dataTextField: "text", dataValueField: "value", dataSource: userDataSource, edit: function (e) { var ddl = e.container.find('[data-role=dropdownlist]').data('kendoDropDownList'); if (ddl) { ddl.open(); } }, change: function () { initGrid(); } }); function initGrid() { var ds = getDataSource(); var History = $("#listView").kendoListView({ dataSource: ds, template: kendo.template($("#template").html()), autoBind: false, pageable: true }); $("#pager").kendoPager({ dataSource: ds, empty: "No Items to Display", autoBind: false }); } function getDataSource() { var dataSource = new kendo.data.DataSource({ transport: { read: { url: "/Services/TitleHistory.ashx?publishedid=" + $("#SearchHistory")[0].value + "&startDate=" + $("#datestart")[0].value + "&endDate=" + $("#dateend")[0].value + "&filterUser=" + $("#user-Search")[0].value, dataType: "jsonp" }, serverOperation:false }, serverPaging: true, schema: { total: function (response) { if (response[0]) { return response[0].total; } else { return 0; } }, model: { id: "EventType", fields: { EventType: { editable: false, nullable: true }, Details: { editable: false, nullable: true }, Comment: { editable: false, validation: { required: true } }, User: { editable: false, validation: { required: true } }, EventDate: { validation: { required: true }, type: "date", format: "{0:MM-dd-yyyy}" }, editable: false, Title: { editable: false, nullable: false }, UserId: { editable: false, nullable: false }, PublishedId: { editable: false, nullable: false, } }, } }, pageSize: 5 }); dataSource.fetch(); return dataSource; }