You are using a very old version of the Kendo user interface in your violin, so the selection did not help either. The reason he did not find deleteRecord is because you set your script to window.onLoad , which happens after document.ready .
Regarding the row index: you need to define the index in relation to the grid data rows (if you just get the index of the selected row, it will also count grouping rows, the same will happen for rows with detailed information if you had any), so you can use grid.items() as follows:
var grid = $("#grid").data("kendoGrid"); var dataRows = grid.items(); var rowIndex = dataRows.index(grid.select());
See the demo here .
If you are really interested in accessing the data of the selected row, you should use something like this (note that all this assumes that your grid is set to select a cell or a single row):
var tr = grid.select().closest("tr"); var dataItem = grid.dataItem(tr);
source share