Asp.net mvc 4 剑道UI MVC中的网格无法编辑
我使用KendoUIMVC创建了一个Asp.net mvc 4 剑道UI MVC中的网格无法编辑,asp.net-mvc-4,razor,kendo-grid,Asp.net Mvc 4,Razor,Kendo Grid,我使用KendoUIMVC创建了一个网格,为管理员用户管理数据库。昨天它可以编辑,但现在我无法编辑或单击网格中的任何按钮。我不知道他们怎么了?有人知道这种情况的解决方案吗 .cshtml: @using AdventureCycle.Models @model IEnumerable<SubCateViewModel> @(Html.Kendo().Grid(Model) .Name("Grid") .Columns(columns => { colum
网格
,为管理员用户管理数据库。昨天它可以编辑,但现在我无法编辑或单击网格中的任何按钮。我不知道他们怎么了?有人知道这种情况的解决方案吗
.cshtml
:
@using AdventureCycle.Models
@model IEnumerable<SubCateViewModel>
@(Html.Kendo().Grid(Model)
.Name("Grid")
.Columns(columns =>
{
columns.Bound(c => c.ProductSubcategoryID).Width(140);
columns.Bound(c => c.ProductCategoryID).Width(140);
columns.Bound(c => c.NameofBike).Width(190);
columns.Bound(c => c.Name).Width(190);
columns.Template(c => { }).ClientTemplate("<a href='" + Url.Action("", "StoreManager") + "/#= ID #'" + "><img src='../GetImage.ashx?ID=@bike.ProductProductPhotoes.FirstOrDefault().ProductPhotoID' /></a>").Width(150).Title("Picture");
columns.Bound(c => c.isSelected).Width(120);
})
.Editable(edit => edit.Mode(GridEditMode.InCell))
.Pageable(pageable => pageable
.Refresh(true)
.PageSizes(true)
.ButtonCount(5))
.Sortable()
.Groupable()
.ToolBar(tb =>
{
tb.Create();
tb.Save();
})
.Filterable()
.DataSource(datasource => datasource
.Ajax()
.Batch(true)
.ServerOperation(false)
.Model(model => model.Id(c => c.ProductID))
.Read("GetSub","Grid")
.Update("UpdateSub","Grid")
.Create("InsertSub","Grid")
.Destroy("DeleteSub","Grid"))
)
@使用AdventureCycle.Models
@模型IEnumerable
@(Html.Kendo().Grid(模型)
.名称(“网格”)
.列(列=>
{
columns.Bound(c=>c.productSubcategorid).Width(140);
columns.Bound(c=>c.ProductCategoryID).Width(140);
columns.Bound(c=>c.NameofBike).Width(190);
columns.Bound(c=>c.Name).Width(190);
columns.Template(c=>{}).ClientTemplate(“”).Width(150).Title(“图片”);
columns.Bound(c=>c.isSelected).Width(120);
})
.edit(编辑=>edit.Mode(GridEditMode.InCell))
.Pageable(Pageable=>Pageable
.刷新(真)
.页面大小(真)
.按钮计数(5))
.Sortable()
.Groupable()
.工具栏(tb=>
{
tb.Create();
tb.Save();
})
.可过滤()
.DataSource(DataSource=>DataSource
.Ajax()
.Batch(真)
.ServerOperation(错误)
.Model(Model=>Model.Id(c=>c.ProductID))
.Read(“GetSub”、“Grid”)
.Update(“UpdateSub”、“Grid”)
.Create(“InsertSub”、“Grid”)
.销毁(“删除子网格”))
)
看起来服务器操作错误是导致问题的原因,如果不是的话
尝试在更新和编辑命令中使用Lambda表达式
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("Orders_Read", "Orders"))
.Update(update => update.Action("Orders_Update", "Orders"))
.Destroy(update => update.Action("Orders_Delete", "Orders"))