I am migrating my application form MVC Extension to the Telerik UI for ASP.NET MVC. Changed the grid to:
@(Html.Kendo().Grid((IEnumerable<vw_Client_info>)ViewBag.Clients) .Name("Clients") .Columns(columns => { columns.Bound(c => c.ClientID).Width(30).Title("Client ID").Hidden(); columns.Bound(c => c.FullName).Width(130); }) .DataSource(dataSource => dataSource .Ajax() .Model(model => model.Id(p => p.ClientID)) .Read(read => read.Action("AllClientsSelection", "Visit"))) .Selectable() .Events(events => { events.Change("onRowSelected"); }) .RowAction(row => row.Selected = row.DataItem.ClientID.Equals(ViewData["id"])) ) To get the cell value, I used before :
function onRowSelected(e) { var detailGrid = $('#Visit').data('tGrid'); id = e.row.cells[0].innerHTML; fullname = e.row.cells[1].innerHTML; $('#ClientFullName').text(fullname); detailGrid.rebind(); } This works with Telerik MVC Extensions , but not with the new version, I get this error:
Unable to get property 'cells' of undefined or null reference. I tried to use:
function onRowSelected(e) { var detailGrid = $('#Visit').data('kendoGrid'); var id = e.row.ClientID; var fullname = e.row.FullName; $('#ClientFullName').text(fullname); detailGrid.rebind(); } I get this error:
Unable to get property 'ClientID' of undefined or null reference