I found a slightly more elegant way to do this, which borrows the mututilva answer.
Start by entering the hidden column and change event in the same way:
.DataKeys(keys => keys.Add(o => o.Id)) .Selectable() .Columns(columns => { columns.Bound(o => o.Id).Hidden(); columns.Bound(o => o.Name); columns.Bound(o => o.Description); }) .ClientEvents(events => events.OnRowSelect("onRowSelect"))
But then in the javascript function there is a better way to actually select the object and then the hidden line:
function onRowSelect(e) { var grid = e.sender; var currentitem = grid.dataItem(this.select()); var Id = currentitem.Id;
A source
source share