Kendo grid - How to get the row details on RowSelected?

KeenUser picture KeenUser · May 9, 2014 · Viewed 37k times · Source

As part of Kendo grid upgrade, some of my old code seems to be not working due to change in implementation

I have used events.Change to trigger a row click event(Sample code below)

@(Html.Kendo().Grid(Model.BankSearchList).Name("Grid")
                                .Events(events =>
                                {
                                    events.Change("onRowSelected");
                                    events.DataBound("onGrindBound");
                                })

In my onRowSelected(e) method, I was accessing key column member using

e.row.cells[0].innerHTML

e.row is undefined now. What is the right way to use now? Using events.Change for row selected functionality the right way to do so?

Answer

Dave picture Dave · May 9, 2014

here is reference on how to get selected row detail jsfiddle . click on row to get its detail.

var gview = $("#grid").data("kendoGrid");
//Getting selected item
var selectedItem = gview.dataItem(gview.select());
alert(selectedItem.ShipName);