This question is locked. New answers and comments are not allowed.
My goal: To allow a user to select a row and fire an ActionResult in the controller with the values of the selected row.
Code to get the event to fire javascript, which isn't what I want but would at least prove that Telerik is smart enough to see the row get selected (copied from google searches I found):
Code to get the event to fire javascript, which isn't what I want but would at least prove that Telerik is smart enough to see the row get selected (copied from google searches I found):
@(Html.Telerik().Grid(Model)
.Name(
"Grid")
.DataKeys(keys => keys.Add(x => x.Name))
.Columns(columns =>
{
columns.Bound(x => x.Name).Width(50);
columns.Bound(x => x.Type).Width(50);
})
.Sortable()
.Selectable()
.ClientEvents(events => events.OnRowSelected("onRowSelected"))
<script type="text/javascript">
function onRowSelected(e) {
//var id = e.row.cells[0].innerHTML;
alert("foo");
}
</script>
But even that doesn't work. Does .Selectable() not make the rows selectable as it would imply? It's Telerik.Web.Mvc version 2011.2.914.340. I have used Telerik grids in the past, but only for editing, inserting, or deleting rows in a table.