or
<script id="matchedTrainTemplate" type="text/x-kendo-template"> @(Html.Kendo().Grid<CNX.Domain.Entities.MatchedT94EDI417Railcar>() .Name("MatchingEDI417s_#=Id#") .Editable(editable => editable.Mode(GridEditMode.PopUp).Window(w => w.Modal(true) .Width(500) .Height(510) .Resizable(x => x.Enabled(true)) //.Events(x => x.Close("ClosingEditWindow")) ) ) .Columns(columns => { columns.Bound(o => o.MATCHING_GUID).Visible(false); columns.Bound(o => o.N7_GUID).Visible(false); columns.Bound(o => o.EDI_OWNER_CODE).Width("50"); columns.Bound(o => o.T94_OWNER_CODE).Width("50"); columns.Bound(o => o.EDI_EQUIPMENT_NUMBER).Width("75"); columns.Bound(o => o.T94_EQUIPMENT_NUMBER).Width("75"); columns.Bound(o => o.EDI_GROSS_WEIGHT).Width("75"); columns.Bound(o => o.EDI_TARE_WEIGHT).Width("75"); columns.Bound(o => o.T94_SEQUENCE_NUMBER); columns.Command(commands => { commands.Edit(); }).Title("Edit Railcar").Width("50"); columns.Bound(o => o.RREGUID).Visible(false); columns.Bound(o => o.EDI_417_GUID).Visible(false); columns.Bound(o => o.HeaderGuid).Visible(false); }) .DataSource(dataSource => dataSource.Ajax() .PageSize(10) .Model(model => model.Id(o => o.MATCHING_GUID)) .Read(read => read.Action("MatchedEDI417sDetail", "MenuEDI", new { matchingGuid = "#=Id#" }).Type(HttpVerbs.Post)) .Update(update => update.Action("MatchedEDI417sUpdate", "MenuEDI" , Model).Type(HttpVerbs.Post)) ) .Pageable() .Sortable() .Filterable() .Events( events => events.Save("detailSave")) .ToClientTemplate() ); </script><script> function detailSave() { alert('Save Event'); this.dataSource.read(); }</script>[HttpPost] public ActionResult MatchedEDI417sUpdate(MatchedT94EDI417Railcar railCar, [DataSourceRequest] DataSourceRequest request) { TempData["role"] = GetRole(); matchedT94EDI417RailCarRepository.Save(railCar); return Json(matchedT94EDI417RailCarRepository.RailCarsMatchedT94EDI417(railCar.MATCHING_GUID).ToDataSourceResult(request)); }@{ string controller = ViewContext.GetCurrentController(); string action = ViewContext.GetCurrentAction(); string methodName = "_GetNewGridRows" + "_" + action; WFObjectListViewModel objectListViewModel = Model; }@(Html.Kendo().Grid(objectListViewModel.ObjectDataList) .Name("Grid_" + objectListViewModel.UniqueID) .Columns(columns => { columns.Bound(c => c.ID) .Hidden(true) .Title("wfID"); columns.Bound(c => c.AspSite) .Hidden(true) .Title("aspSite"); for (int i = 0; i < objectListViewModel.FolderColumns.Count; i++) { var id = i; var itemAttributesId = id + 2; if (objectListViewModel.FolderColumns[i].Type == "text") { string template = null; if (Model.FolderColumns[i].ColumnName == "subject") { string wfID = "\"#=ItemAttributes[" + 0 + "]#\""; string aspSite = "\"#=ItemAttributes[" + 1 + "]#\""; string jsOpenWindow = "javascript:openWindow(" + wfID + ", " + aspSite + ")"; template = string.Format("<a href='{0}' style='white-space: nowrap;'>{1}</a>", jsOpenWindow, "#=ItemAttributes[" + itemAttributesId + "]#"); } else { template = string.Format(Model.FolderColumns[id].Template, "#=ItemAttributes[" + itemAttributesId + "]#"); } columns.Bound(c => c.ItemAttributes) .ClientTemplate("#=gridClientTemplate(Unread, 'begin')#" + template + "#=gridClientTemplate(Unread, 'end')#") .Title(Model.FolderColumns[id].ColumnDisplayName) .Hidden(Model.FolderColumns[i].Hidden) .Column.Member = Model.FolderColumns[id].ColumnUniqueName; } else if ((Model.FolderColumns[id].Type == "image") || (Model.FolderColumns[id].Type == "deadline") || (Model.FolderColumns[id].Type == "bit")) { int columnWidth = 22 + (Model.FolderColumns[id].ColumnDisplayName.Length * 5); columns.Bound(c => c.ItemAttributes) .ClientTemplate("#=gridClientTemplate(Unread, 'begin')#" + string.Format(Model.FolderColumns[id].Template, "#=ItemAttributes[" + itemAttributesId + "]#") + "#=gridClientTemplate(Unread, 'end')#") .Title(Model.FolderColumns[id].ColumnDisplayName) .Width(columnWidth) .Hidden(Model.FolderColumns[i].Hidden) .Column.Member = Model.FolderColumns[id].ColumnUniqueName; } } }) .EnableCustomBinding(true) .DataSource(dataSource => dataSource.Ajax() .Read(read => read.Action(methodName, controller, new { folderID = Model.FolderID, searchFilterJson = ViewData["hiddenSearchFilter_Data"] })) .PageSize(Model.EntriesPerPage) .Total(Model.TotalItems) ) .Sortable(sorting => sorting.SortMode(GridSortMode.MultipleColumn)) .Selectable() .Scrollable() .Resizable(resizing => resizing.Columns(true)) .Events(events => events.DataBound("onObjectDataListBound_" + controller + "_" + action)) .Pageable(pageing => pageing.Enabled(true).Refresh(Model.AllowGridRefresh).Input(true).Numeric(false).PreviousNext(true).PageSizes(new int[] {3, 5, 10, 15, 25, 50, 75, 100 })))@(Html.Kendo().Grid<BulletinModel>() .Name("Grid") .Editable(ed => ed.Mode(GridEditMode.PopUp).Window(w => w.Width(950))) .Selectable() .Scrollable(scrollable => scrollable.Virtual(true)) .Sortable() .HtmlAttributes(new { @style = "height: 600px;" }))