Search code examples
asp.net-mvc-4kendo-gridkendo-ui-mvc

Select a row and pass id to another element on the page using KendoGrid


I am in ASP.NET MVC environment and I am creating a page with two parts.

  1. Grid which shows all the employee data
  2. When a user clicks on a particular row in the grid, it shows the employee related data in the part below

I have used the Selectable() attribute on the Grid. However some of the things are not very clear to me that

  1. If it raises any event when I do that?
  2. If not, how to I read the value of a particular row OR any particular column while doing it?

Solution

  • If you want to catch event click, you can use

     $("body").on("dblclick", "#grid tbody tr", function (e) {
      var grid= $("#grid").data('kendoGrid');
      var rowSelect = grid.select();
      var dataSelect = grid.dataItem(rowSelect);
     });