Could you please help us to delete a selected row in a grid by using keyboard delete key.
Thanks
Siva
1 Answer, 1 is accepted
0
Dimiter Madjarov
Telerik team
answered on 22 May 2014, 07:24 AM
Hello Siva,
To achieve this you could bind to the keydown event of the delete button, retrieve the currently selected row with the select method of the Grid API and remove it with the removeRow method.
E.g.
$(function () {
var grid = $("#grid").data("kendoGrid");
grid.table.on("keydown", function (e) {
if (e.keyCode == 46) {
grid.removeRow(grid.select());
}
})
});
I hope this information helps.
Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!