The Insert Bind Data option is required by the Kendo Grid Error any

Kendo Grid shows the following ERROR

The Insert Binding Data option is required by the insert command. Specify Paste or URL in the DataBinding Configuration

@(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)); } 
+5
source share
1 answer

The reason you get this error comes down to the fact that you added the Create button on the toolbar.

When a data source section is added to the grid, it looks for the path to the create command.

eg. for your reading action you have

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

so you need to add the corresponding insert action, for example:

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

if you don’t need to create anything in this grid, then simply remove the create toolbar menu item from the grid.

+12
source

Source: https://habr.com/ru/post/1210670/


All Articles