Как исправить вид сетки - PullRequest
2 голосов
/ 02 апреля 2019

Я реализую функцию пакетного редактирования в Grid Kendo. Я создал сетку кендо. В конце концов, моя проблема в том, что когда я пытаюсь встроить редактирование, вся ячейка становится ячейкой HTML. Что не так с моим кодом. вид

@(Html.Kendo().Grid<webkendo.Models.ProductViewModel>()
            .Name("grid")
            .Columns(columns =>
            {
                columns.Bound(product => product.ProductID).Width(50);
                columns.Bound(product => product.ProductName);
                columns.Bound(product => product.UnitsInStock).Width(50);
                columns.Command(commands =>
                {
                    commands.Destroy(); // The "destroy" command removes data items.
                }).Title("Commands").Width(200);
            })
            .ToolBar(toolbar =>
            {
                toolbar.Create(); // The "create" command adds new data items.
                toolbar.Save(); // The "save" command saves the changed data items.
            })
            .Editable(editable => editable.Mode(GridEditMode.InCell)) // Use in-cell editing mode.
            .DataSource(dataSource =>
                dataSource.Ajax()
                .Batch(true) // Enable batch updates.
                .Model(model =>
                {
                    model.Id(product => product.ProductID); // Specify the property which is the unique identifier of the model.
                    model.Field(product => product.ProductID).Editable(false); // Make the ProductID property not editable.
                })
                .Create(create => create.Action("Products_Create", "Home")) // Action method invoked when the user saves a new data item.
                .Read(read => read.Action("Products_Read", "Home"))  // Action method invoked when the grid needs data.
                .Update(update => update.Action("Products_Update", "Home"))  // Action method invoked when the user saves an updated data item.
                .Destroy(destroy => destroy.Action("Products_Destroy", "Home")) // Action method invoked when the user removes a data item.
            )
            .Pageable()
)

OnLoad enter image description here

когда я пытаюсь редактировать inline enter image description here

Как это случилось?

...