or
<div> @(Html.Kendo().Grid(Model.Items) .Name("GridReportCommerciale") .Columns(columns => { columns.Bound(p => p.Workcentre) .Template(@<div onclick="openVincoli('@item.Workcentre')" class="contentCell" style="font-weight:bold;font-size:11px" >@item.Workcentre</div>) .Title("WC").Width(60); foreach (var sett in Model.SettimaneVisibili) { columns.Template(@<text> @if (item[sett.Clone()] != null && item[sett.Clone()].Diametro > 0) { if (item[sett].Stato == "R") { <div onclick="openCampaign('@item[sett.Clone()].RiferimentoCampagna')" class="contentCell" style="background-color:#FF8C00;"> <div>@string.Format("{0:0.00}", item[sett.Clone()].Diametro)</div> <div>@string.Format("({0:#,##0})", item[sett.Clone()].Quantita)</div> </div> } else { <div onclick="openCampaign('@item[sett.Clone()].RiferimentoCampagna')" class="contentCell" style="background-color:#FFFFE0;"> <div>@string.Format("{0:0.00}", item[sett.Clone()].Diametro)</div> <div>@string.Format("({0:#,##0})", item[sett.Clone()].Quantita)</div> </div> } } else { <div class="contentCell" > <div> </div> <div> </div> </div> } </text>) .HeaderTemplate( @<div> <div>@string.Format("{0:00}-{1:0000}", sett.Clone().NumeroSettimana, sett.Clone().Anno)</div> <div>@string.Format("{0}", sett.Clone().GetDayRange())</div> </div>) .Width(70); } }) .Scrollable() .ToolBar(t=>{ t.Template(@<div class="k-toolbar k-grid-toolbar k-grid-top"> <a class="k-button k-button-icontext " href="/ReportCommerciali?pos=-1"> <span></span> Indietro </a> <a class="k-button k-button-icontext " href="/ReportCommerciali?pos=1"> <span></span> Avanti</a> <span>@Model.VisibleRangeDescription</span> </div>); }) //.Resizable(resize => resize.Columns(true)) //.Reorderable(reorder => reorder.Columns(false)) .HtmlAttributes(new { style = "height: 700px;" }) )</div>.Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("EditTemplate"))@using GIS.Services.HTRAM.Types@using HResource = ResourceHelper;@model GIS.Services.HTRAM.Types.HtramProjectCategoryResults<input name="DropDownSelected" type="Hidden" id="DropDownSelected" value="0" /><script type="text/javascript"> function filterCategoryValues() { return 13; }</script><div class="display-label-table"> <div class="display-label-row"> @Html.Label(@HResource.HTRAMResource.Category, new { @class = "display-label-cell" }) @(Html.Kendo().DropDownList() .Name("categories") .DataTextField("Name") .DataValueField("CategoryID") .DataSource(source => { source.Read(read => { read.Action("GetCategories", "Category"); }); }) .Value(Model.CategoryID.ToString()) ) </div></div>@{ if ( (ViewData["categoryValues"] as List<HtramCategoryValue>).Count > 0) { <div class="display-label-table"> <div class="display-label-row"> @Html.Label(@HResource.HTRAMResource.MilePostFrom, new { @class = "display-label-cell" }) @Html.EditorFor(model => model.MilePostFrom, new { @class = "display-field-cell" }) @Html.ValidationMessageFor(model => model.MilePostFrom) </div> <div class="display-label-row"> @Html.Label(@HResource.HTRAMResource.MilePostTo, new { @class = "display-label-cell" }) @Html.EditorFor(model => model.MilePostTo, new { @class = "display-field-cell" }) @Html.ValidationMessageFor(model => model.MilePostTo) </div> <div class="display-label-row"> @Html.Label(@HResource.HTRAMResource.Comment, new { @class = "display-label-cell" }) @Html.EditorFor(model => model.Comment, new { @class = "display-field-cell" }) @Html.ValidationMessageFor(model => model.Comment) </div> <div class="display-label-row"> @Html.Label(@HResource.HTRAMResource.Reference, new { @class = "display-label-cell" }) @Html.EditorFor(model => model.Reference, new { @class = "display-field-cell" }) @Html.ValidationMessageFor(model => model.Reference) </div> @{ if ((ViewData["categoryValues"] as List<HtramCategoryValue>)[0].Name != "") { <div class="display-label-row"> @Html.Label(@HResource.HTRAMResource.Value, new { @class = "display-label-cell" }) @(Html.Kendo().DropDownList() .Name("category-drop-val") .DataTextField("Name") .DataValueField("CategoryValueID") .DataSource(source => { source.Read(read => { read.Action("GetCategoryValues", "Category") .Data("filterCategoryValues"); }) .ServerFiltering(true); }) .Enable(false) .AutoBind(false) .CascadeFrom("categories") .Value(Model.CategoryValueID.ToString()) ) </div> } else { <div class="display-label-row"> @Html.Label(@HResource.HTRAMResource.Value, new { @class = "display-label-cell" }) @Html.EditorFor(model => model.CategoryValue, new { @class = "display-field-cell" }) @Html.ValidationMessageFor(model => model.CategoryValue) </div> } } </div> }}@Html.HiddenFor(model => model.ProjectID)@Html.HiddenFor(model => model.CategoryID)@Html.HiddenFor(model => model.CategoryID)@Html.HiddenFor(model => model.CategoryName)@Html.HiddenFor(model => model.CategoryValueID)@Html.HiddenFor(model => model.CategoryWeight)@Html.HiddenFor(model => model.CreateDate)@Html.HiddenFor(model => model.CreateUser)@Html.HiddenFor(model => model.ProjectID)@Html.HiddenFor(model => model.ProjectsCategoryResultsID)@Html.HiddenFor(model => model.VulnerabilityValue)@(Html.Kendo().Grid(Model.Cart.Products) .Name("ProductGrid") .Columns(columns => { columns.Bound(p => p.HCode).Title("HCode").Width(90); columns.Bound(p => p.VCode).Title("VCode").Width(90); columns.Bound(p => p.Desc).Title("Description"); columns.Bound(p => p.Qty).Title("Qty").Width(70).ClientTemplate("#=dispTextbox(HCode, Qty)#").HeaderHtmlAttributes(new { @style = "text-align:center;" }).HtmlAttributes(new { style = "text-align:center;" }); columns.Bound(p => p.UPrice).Width(100).Title("Unit<br />Price").Format("{0:c}").HtmlAttributes(new { style = "text-align:right;" }).HeaderHtmlAttributes(new { style = "text-align:center;" }).ClientFooterTemplate("Total:").FooterHtmlAttributes(new { style = "text-align:right;" }); columns.Bound(p => p.XPrice).Width(100).Title("Extended<br />Price").ClientTemplate("#= kendo.format('{0:c}', Qty * UPrice) #").FooterHtmlAttributes(new { style = "text-align:right;" }).ClientFooterTemplate("#= kendo.format('{0:c}', sum)#").HtmlAttributes(new { style = "text-align:right;" }).HeaderHtmlAttributes(new { style = "text-align:center;" }); }) .ClientDetailTemplateId("productsOrderTemplate") .Resizable(resizing => resizing.Columns(true)) .Pageable() .Selectable(s => s.Mode(Kendo.Mvc.UI.GridSelectionMode.Single)) .Sortable() .Scrollable() .DataSource(dataSource => dataSource .Ajax() .ServerOperation(false) .Aggregates(aggregates => { aggregates.Add(p => p.VCode).Count(); aggregates.Add(p => p.UPrice).Sum(); aggregates.Add(p => p.XPrice).Sum(); }) .Model(model => model.Id(p => p.HCode)) ) .Events(events => events.DataBound("dataBoundProds")))<script id="productsOrderTemplate" type="text/kendo-tmpl"> @(Html.Kendo().Grid(Model.Cart.ProductOrders) .Name("Orders_#=HCode#") .Columns(columns => { columns.Bound(o => o.OrderNo).Width(101).Title("Order Number"); columns.Bound(o => o.Date).Width(140).Title("Date"); columns.Bound(o => o.Qty).Width(100).Title("Quantity"); }) .DataSource(dataSource => dataSource .Ajax() .Read(read => read.Action("loadProductsOrder", "OrderEntry", new { HCode = "#=HCode#" })) ) .Sortable() .ToClientTemplate() )</script><script> function dataBoundProds() { this.expandRow(this.tbody.find("tr.k-master-row").first()); }</script>Error: Invalid template:' <div class="k-widget k-grid" id="Orders_#=HCode#"><table cellspacing="0"><colgroup><col style="width:101px" /><col style="width:140px" /><col style="width:100px" /></colgroup><thead class="k-grid-header"><tr><th class="k-header" data-field="OrderNo" data-title="Order Number" scope="col"><a class="k-link" href="/OrderEntry/loadProductsOrder?HCode=%23%3DHCode%23&Orders_%23%3DHCode%23-sort=OrderNo-asc">Order Number</a></th><th class="k-header" data-field="Date" data-title="Date" scope="col"><a class="k-link" href="/OrderEntry/loadProductsOrder?HCode=%23%3DHCode%23&Orders_%23%3DHCode%23-sort=Date-asc">Date</a></th><th class="k-header" data-field="Qty" data-title="Quantity" scope="col"><a class="k-link" href="/OrderEntry/loadProductsOrder?HCode=%23%3DHCode%23&Orders_%23%3DHCode%23-sort=Qty-asc">Quantity</a></th></tr></thead><tbody><tr class="t-no-data"><td colspan="3"></td></tr></tbody></table></div><script> jQuery(function(){jQuery("\#Orders_#=HCode#").kendoGrid({"columns":[{"title":"Order Number","width":"101px","field":"OrderNo","encoded":true},{"title":"Date","width":"140px","field":"Date","encoded":true},{"title":"Quantity","width":"100px","field":"Qty","encoded":true}],"sortable":true,"scrollable":false,"dataSource":{"transport":{"read":{"url":"/OrderEntry/loadProductsOrder?HCode=#=HCode#"}},"serverPaging":true,"serverSorting":true,"serverFiltering":true,"serverGrouping":true,"serverAggregates":true,"type":"aspnetmvc-ajax","filter":[],"schema":{"data":"Data","total":"Total","errors":"Errors","model":{"fields":{"Date":{"type":"date","defaultValue":null},"sDate":{"type":"string"},"Qty":{"type":"number"},"OrderNo":{"type":"string"}}}}}});});<\/script> ' Generated code:'var o,e=kendo.htmlEncode;with(data){o='\n <div class="k-widget&';32;k-grid" id="Orders_;o+='=HCode';"><table cellspacing="0"><colgroup><col style="width:101px" /><col style="width:140px" /><col style="width:100px" /></colgroup><thead class="k-grid-header"><tr><th class="k-header" data-field="OrderNo" data-title="Order&;o+='32;Number" scope="col"><a class="k-link" href="/OrderEntry/loadProductsOrder?HCode=%23%3DHCode%23&Orders_%23%3DHCode%23-sort=OrderNo-asc">Order Number</a></th><th class="k-header" data-field="Date" data-title="Date" scope="col"><a class="k-link" href="/OrderEntry/loadProductsOrder?HCode=%23%3DHCode%23&Orders_%23%3DHCode%23-sort=Date-asc">Date</a></th><th class="k-header" data-field="Qty" data-title="Quantity" scope="col"><a class="k-link" href="/OrderEntry/loadProductsOrder?HCode=%23%3DHCode%23&Orders_%23%3DHCode%23-sort=Qty-asc">Quantity</a></th></tr></thead><tbody><tr class="t-no-data"><td colspan="3"></td></tr></tbody></table></div><script>\n\tjQuery(function(){jQuery("#Orders_'+(HCode)+'").kendoGrid({"columns":[{"title":"Order Number","width":"101px","field":"OrderNo","encoded":true},{"title":"Date","width":"140px","field":"Date","encoded":true},{"title":"Quantity","width":"100px","field":"Qty","encoded":true}],"sortable":true,"scrollable":false,"dataSource":{"transport":{"read":{"url":"/OrderEntry/loadProductsOrder?HCode='+(HCode)+'"}},"serverPaging":true,"serverSorting":true,"serverFiltering":true,"serverGrouping":true,"serverAggregates":true,"type":"aspnetmvc-ajax","filter":[],"schema":{"data":"Data","total":"Total","errors":"Errors","model":{"fields":{"Date":{"type":"date","defaultValue":null},"sDate":{"type":"string"},"Qty":{"type":"number"},"OrderNo":{"type":"string"}}}}}});});\n<\/script>\n ';}return o;'Dim CsvGrid As Kendo.Mvc.UI.Grid(Of BO.Models.OutOfNetwork) = Html.Kendo.Grid(Of BO.Models.OutOfNetwork).Name("CsvGrid") _.Columns(Sub(columns) .....