or
@(Html.Kendo().Grid(Model) .Name("BatchGrid") .Pageable() .Sortable() .Scrollable() .HtmlAttributes(new { style = "height:525px; width:1200px" }) .Columns(columns => { columns.Bound(b => b.BatchID) .Width("300px") .Title("Batch ID") .Visible(false); columns.Bound(b => b.ShortBatchID) .Width("100px") .Title("Batch ID"); columns.Bound(b => b.HasErrorTransaction) .Width("50px") .Title("Err").Visible(false); columns.Command(c => c.Custom("Post Batch") .Click("onClickPostBatch") .HtmlAttributes(new { style = "width:100px;" })); columns.Bound(b => b.Created_Emp_Name) .Width("200px") .Title("Created Employee"); columns.Bound(b => b.Transmitted_DateTime) .Width("175px") .Format("{0:MM/dd/yyyy hh:mm tt}") .Title("Transmitted"); columns.Bound(b => b.Completed_DateTime) .Width("175px") .Format("{0:MM/dd/yyyy hh:mm tt}") .Title("Completed"); columns.Command(c => c.Custom("Delete Batch") .Click("onClickDeleteBatch") .HtmlAttributes(new { style = "width:100px;" })); } ) .DataSource(dataSource => dataSource .Ajax() .Sort(sort => sort.Add("HasErrorTransaction").Ascending()) // <-- initial sort .PageSize(12) .Read(read => read.Action("FetchBatchCollection", "Home").Data("addlData")) .ServerOperation(false) ) .Events(events => events.DataBound("onBatchGridDataBound") .DetailExpand("onBatchGridExpand")) .ClientDetailTemplateId("transactions") )<!-- Nested grid for transaction object, member of BatchHeader.TranCollection There can be many ITransaction objects per BatchHeader --><script id="transactions" type="text/kendo-tmpl"> @(Html.Kendo().Grid<ROAMTranReview.ROAMHostSvc.TransactionBase>() .Name("TranGrid_#=BatchID#") // makes the sub-grid name unique so that it will be displayed on each child row. .HtmlAttributes(new { style = "height:535px; width:1400px" }) .Columns(columns => { columns.Bound(b => b.BatchID) .Visible(false); columns.Bound(b => b.TransactionType) .Visible(false); columns.Bound(b => b.ID) .Width("300px") .Title("Transaction ID") .Visible(false); columns.Bound(b => b.ShortTranID) .Width("100px") .Title("Tran ID"); columns.Command(c => c.Custom("View Transaction") .Click("onClickViewTransaction") .HtmlAttributes(new { style = "width:100px;" })); columns.Bound(b => b.TranTypeDisplayText) .Width("100px") .Title("Type"); columns.Bound(b => b.ItemID) .Width("100px") .Title("Item ID"); columns.Bound(b => b.ItemDescription) .Width("300px") .Title("Item Description"); columns.Bound(b => b.Quantity) .Width("50px") .Title("Qty"); columns.Bound(b => b.WorkOrderTask) .Width("100px") .Title("Workorder"); columns.Bound(b => b.EmployeeName) .Width("200px") .Title("Employee"); columns.Command(c => c.Custom("Delete Transaction") .Click("onClickDeleteTransaction") .HtmlAttributes(new { style = "width:155px;" })); columns.Bound(b => b.PostingFlagDisplayText) .Width("150px") .Title("Posting Flag"); }) .Scrollable() .Pageable() .DataSource(dataSource => dataSource .Ajax() .PageSize(6) .Read(read => read.Action("FetchTransactionCollection", "Home", new { batchID = "#=BatchID#" })) ) .Events(events => events.DataBound("onTranGridDataBound") .DetailExpand("onTranGridExpand")) .ToClientTemplate() )</script>
<div class="gantt-wrapper"> @(Html.Kendo().Gantt(Of IMS_2.Models.Task, IMS_2.Models.Dependency)().Name("gantt") _ .Columns(Sub(columns) columns.Bound(Function(c) c.ID).Title("ID").Width(50) columns.Bound("title").Editable(True).Sortable(True) columns.Bound("start").Title("Start Time").Format("{0:MM/dd/yyyy}").Width(100).Editable(True).Sortable(True) columns.Bound("end").Title("End Time").Format("{0:MM/dd/yyyy}").Width(100).Editable(True).Sortable(True) End Sub) _ .Views(sub(views) views.DayView() views.WeekView(Function(weekView) weekView.Selected(True)) views.MonthView() End Sub) _ .DataSource(Function(d) d.Read(Function(read) read.Action("ReadTasks", "Gantt")).Model(Sub(m) m.Id(Function(f) f.ID) m.ParentId(Function(f) f.ParentID) m.OrderId(Function(f) f.OrderID) m.Field(Function(f) f.Expanded) End Sub))) </div><div class="gantt-wrapper"> <div data-role="gantt" id="gantt"></div><script> jQuery(function(){jQuery("#gantt").kendoGantt({"columns":[{"title":"ID","width":50,"sortable":true,"field":"ID"},{"title":"Project Name","editable":true,"sortable":true,"field":"title"},{"title":"Start Time","format":"{0:MM/dd/yyyy}","width":100,"editable":true,"sortable":true,"field":"start"},{"title":"End Time","format":"{0:MM/dd/yyyy}","width":100,"editable":true,"sortable":true,"field":"end"}],"views":[{"type":"day"},{"selected":true,"type":"week"},{"type":"month"}],"dataSource":{"type":(function(){if(kendo.data.transports['aspnetmvc-ajax']){return 'aspnetmvc-ajax';} else{throw new Error('The kendo.aspnetmvc.min.js script is not included.');}})(),"transport":{"read":{"url":"/Gantt/ReadTasks"},"prefix":""},"schema":{"data":"Data","total":"Total","errors":"Errors","model":{"id":"ID","fields":{"ID":{"type":"number"},"title":{"from":"Title","type":"string"},"start":{"from":"Start","type":"date"},"end":{"from":"End","type":"date"},"parentId":{"from":"ParentID","type":"number"},"orderId":{"from":"OrderID","type":"number"},"percentComplete":{"from":"PercentComplete","type":"number"},"expanded":{"from":"Expanded","type":"boolean"},"summary":{"from":"Summary","type":"boolean"}}}}},"dependencies":{"type":(function(){if(kendo.data.transports['aspnetmvc-ajax']){return 'aspnetmvc-ajax';} else{throw new Error('The kendo.aspnetmvc.min.js script is not included.');}})(),"transport":{"read":{"url":""},"prefix":""},"schema":{"data":"Data","total":"Total","errors":"Errors","model":{"fields":{"DependencyID":{"type":"number"},"PredecessorId":{"type":"number"},"SuccessorId":{"type":"number"},"Type":{"type":"number"}}}}}});});</script> </div> </div>