or
public class Activity { public string ActivityId { get; set; } public string Description { get; set; } public List<Activity> Activities { get; set; } }
@(Html.Kendo().TreeView() .Name("treeviewTierQueue") .DataTextField("Text") .DataSource(dataSource => dataSource .Read(read => read.Action("GetTierQueueList", "Enum")) ))public JsonResult GetTierQueueList(string level){ var items = new List<NestedSelectListItem>() { new NestedSelectListItem {Id = "0", Text = "All Analysts"}, new NestedSelectListItem {Id = "1", Text = "All Groups"}, new NestedSelectListItem { Id = "2", Text = "Service Desk", hasChildren=true, Items = new List<NestedSelectListItem> () { new NestedSelectListItem {Id = "2a", Text = "2nd Level"}, new NestedSelectListItem {Id = "2b", Text = "2nd Level B"}, new NestedSelectListItem { Id = "2c", Text = "2nd Level C", hasChildren= true, Items = new List<NestedSelectListItem> () { new NestedSelectListItem {Id = "3a", Text = "3rd Level"}, new NestedSelectListItem {Id = "3b", Text = "3rd Level B"} } } } } }; if (!String.IsNullOrEmpty(level)) { var filtered = items.First(i => i.Id == level).Items; items = filtered; } return Json(items.AsEnumerable(), JsonRequestBehavior.AllowGet);}@(Html.Kendo().ListView<CorrectiveActionItemModel>() .Name("corrective-action-items-listview") .TagName("div") .ClientTemplateId("corrective-action-item-view-template") .DataSource(dataSource => dataSource .Model(model => { model.Id("CorrectiveActionItemID"); model.Field(f => f.CorrectiveActionPlanID).DefaultValue(this.Model.CorrectiveActionPlanID); model.Field(f => f.CorrectiveActionItemType); }) .PageSize(1) .Create(create => create.Action("Item_Create", "CorrectiveActionItem", new { this.Model.CorrectiveActionPlanID })) .Read(read => read.Action("Items_Read", "CorrectiveActionItem", new { this.Model.CorrectiveActionPlanID })) .Update(update => update.Action("Item_Update", "CorrectiveActionItem")) .Destroy(destroy => destroy.Action("Item_Destroy", "CorrectiveActionItem")) ) .Pageable() .Editable())@using Steton.Web.MVC.Model@model CorrectiveActionItemModel<div class="corrective-action-item-display"> <div class="edit-buttons"> <a class="k-button k-button-icontext k-update-button" href="\\#"><span class="k-icon k-update"></span></a> <a class="k-button k-button-icontext k-cancel-button" href="\\#"><span class="k-icon k-cancel"></span></a> </div> @Html.HiddenFor(m => m.CorrectiveActionItemID) @Html.HiddenFor(m => m.CorrectiveActionPlanID) <div class="action-section"> @Html.LabelFor(m => m.DirectiveText) @Html.TextAreaFor(m => m.DirectiveText) </div> <div class="action-section"> @Html.LabelFor(m => m.ActionTakenText) @Html.TextAreaFor(m => m.ActionTakenText) </div> <div class="action-section"> <div style="clear:both"> <div class="action-sub-edit-section"> <div> @Html.LabelFor(m => m.DueDate) @(Html.Kendo().DatePicker() .Name("DueDate") .Value("12/31/2013")) </div> <div> @Html.LabelFor(m => m.IsCompleted) @Html.CheckBoxFor(m => m.IsCompleted) </div> </div> <div class="action-sub-edit-section"> <div> @Html.LabelFor(m => m.CorrectiveActionItemType) @Html.EditorFor(m => m.CorrectiveActionItemType) </div> </div> </div> </div></div>@using System.Collections@(Html.Kendo().DropDownList() .Name("CorrectiveActionItemType") .DataTextField("TypeName") .DataValueField("CorrectiveActionItemTypeID") .DataSource(read => read.Read("Types","CorrectiveActionItem", new { correctiveActionPlanID = "#=CorrectiveActionPlanID#" }))).Read(read => read.Action("Containers_Read", "ContainerAdmin")) .Create(update => update.Action("Containers_Create", "ContainerAdmin")) .Update(update => update.Action("Containers_Update", "ContainerAdmin")) .Destroy(update => update.Action("Containers_Delete", "ContainerAdmin"))public ActionResult Containers_Read([DataSourceRequest] DataSourceRequest request) { return Json(_repository.GetAllAssetTakeOnContainers().ToDataSourceResult(request)); }public List<AssetTakeOnContainer> GetAllAssetTakeOnContainers() { using (var context = new AssetTakeOnContext()) { context.Configuration.LazyLoadingEnabled = false; return context.AssetTakeOnContainers.Include("TakeOns").Include("LocationLevel1").Include("LocationLevel2").Include("LocationLevel3").Include("CostCntrLevel1").Include("CostCntrLevel2").Include("CostCntrLevel3").Include("Contact").Include("RoomType").Where(c => c.IsDeleted == false).ToList(); } }[AcceptVerbs(HttpVerbs.Post)] public ActionResult Containers_Update([DataSourceRequest] DataSourceRequest request, AssetTakeOnContainer container) { _repository.UpdateAssetTakeOnContainer(container); return Json(ModelState.ToDataSourceResult()); }