插入命令需要插入数据绑定设置 Kendo Grid Error anyone

The Insert data binding setting is required by the insert command Kendo Grid Error anyone

Kendo Grid 显示以下错误

插入命令需要插入数据绑定设置。请在 DataBinding 配置中指定插入操作或 url

@(Html.Kendo().Grid<Pa.Portal.KazangService.KazangAccount>()
    .Name("grids")
    .Columns(columns =>
    {
        columns.Bound(g => g.Id);
        columns.Bound(g=>g.UserName);
        columns.Bound(g=>g.Password);
        columns.Bound(g=>g.Channel);
       
    })
    .ToolBar(toolbar => toolbar.Create()) 
    .Pageable()
    .Sortable()
    .Scrollable()
    .AutoBind(true)
    .HtmlAttributes(new { style = "height:430px;" })
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(20)      
        .Model(m => m.Id(h => h.Id))      
        .Read(read => read.Action("LoadAllkazangAccounts", "Kazang"))    
        ))

CONTROLLER


  public ActionResult LoadAll([DataSourceRequest] DataSourceRequest request)
        {
            IKazangBusinessService client = PaChannelFactory<IKazangBusinessService>.Default.CreateChannel();
            IEnumerable<KazangAccount> KaList = client.GetAllKazangAccounts().ToList();
            ((IChannel)client).Close();
            return Json(KaList.ToDataSourceResult(request));
        }

您收到此错误的原因是您在工具栏中添加了“创建”按钮。

将此添加到网格后,数据源部分正在寻找创建命令路径。

例如。对于您的阅读操作,您有

.Read(read => read.Action("LoadAllkazangAccounts", "Kazang"))   

因此您需要添加适当的插入操作,例如:

.Create(create=> create.Action("CreatekazangAccounts", "Kazang"))   

如果您不需要在此网格中创建任何内容,则只需从网格中删除创建工具栏菜单项。