I have this grid with Edit and Destroy column command buttons. As I click the Delete/Destroy button it instantly calls the Destroy action without waiting for the delete confirmation. How can I solve this?
@(Html.Kendo().Grid<Models.ViewModel>()
.Name("grid")
.EnableCustomBinding(true)
.Columns(columns =>
{
columns.Command(command =>
{
command.Edit();
command.Destroy();
}).Width(180);
columns.Bound(p => p.Sorting).Width(100).Filterable(false);
columns.Bound(p => p.Code).Width(200).Filterable(true);
columns.Bound(p => p.Description).Filterable(true);
})
.ToolBar(toolbar =>
{
toolbar.Search();
})
.Editable(editable => editable.Mode(GridEditMode.PopUp).DisplayDeleteConfirmation(true))
.Filterable()
.Pageable()
.DataSource(dataSource => dataSource
.Ajax()
.Events(events => events.Error("error_handler"))
.Model(model => model.Id(p => p.Id))
.Read("gridReadDataSource", "MyGrid")
.Update("gridEditDataSource", "MyGrid")
.Destroy("gridDeleteDataSource", "MyGrid")
)
)
have you tried removing .displaydeleteconfirmation(true)
I’ve encountered this on a couple of occasions with some older releases. The default is to provide a confirmation. I now only include this with false when i want to supress the confirmation.