or
@(Html.Kendo().Grid<object>() .HtmlAttributes(new { style = "height: 80%;" }) .Name("grid-records") .Columns(columns => { columns.LoadSettings(Model.GridColumns); foreach (GridColumnSettings item in Model.GridColumns) { ModelFieldDescriptor modelField = new ModelFieldDescriptor(); modelField.Member = item.Member; modelField.MemberType = item.MemberType; modelField.DefaultValue = null; modelField.IsEditable = true; columns.Container.DataSource.Schema.Model.Fields.Add(modelField); } //columns.Command(command => { command.Edit(); command.Destroy(); }).HtmlAttributes(new { style = "float:right;" }); columns.Command(command => command.Custom("ViewDetails")); }) .Groupable() .Pageable() .Sortable() .Scrollable() .Filterable(Web.Helpers.KendoI18n.SetGridFilterableSettings) //.Editable(editable => editable.Mode(GridEditMode.InLine)) .DataSource(dataSource => dataSource .Ajax() .Events(events => events.Error("error_handler")) .Read(read => read.Action("GetRecords", "Records", new { currentTableId = Model.CurrentTableId })) //.Update(update => update.Action("UpdateRecordFromGrid", "Design")) //.Destroy(destroy => destroy.Action("DeleteRecordFromGrid", "Design")) ) )@model ISPIS.Models.TerenskiRezultatFK@section headCultureContent { <script src="@Url.Content("~/Scripts/kendo.culture.sr-Latn-RS.min.js")"></script>} <script type="text/javascript"> //set culture of the Kendo UI kendo.culture("sr-Latn-RS");</script> @{ ViewBag.Title = "Create"; Culture = "sr-Latn-RS";}<div class="editor-label"> @Html.LabelFor(model => model.DatumOcitavanja)</div><div class="editor-field"> @(Html.Kendo().DateTimePicker() .Name("DatumOcitavanja") .Value(DateTime.Now) /*.Culture("sr-Latn-RS")*/ .Format("dd.MM.yyyy HH:mm") .HtmlAttributes(new { style = "width:220px" }) ) @Html.ValidationMessageFor(model => model.DatumOcitavanja)</div><script type="text/x-kendo-tmpl" id="template">
<div>
<dl>
<dt>Street</dt> <dd>${Address.Street}</dd>
<dt>City</dt> <dd>${Address.City}</dd>
</dl>
</div>
</script>
But this leads to JavaScript exceptions, saying that the property is undefined. How can I handle this? Any idea is welcome, but this really a serious problem with complex data models. I cannot reduce my viewmodel to only have primitive properties, that woud cause too much effort...[DisplayName("Vendor")]public int? VendorId { get; set; }[DisplayName("Category")]public int CategoryId { get; set; }@(Html.Kendo().AutoComplete().Name("Expense.VendorId") .DataTextField("VendorName") .Filter(FilterType.StartsWith) .Placeholder("Type in a Vendor...") .DataSource(dataSource => { dataSource.Read(read => read.Action("_GetVendors", "Expense")); }) )