how to get cell click event in kendo grid

11,086

To add onto the previous answers: In your grid, add an event binding

@(Html.kendo().Grid<StudentViewModel>()
   .Columns(...)
   .Events(events => events.Change("onChange"))
  })

Then, in your javascript section, add a function like Arturo suggested:

function onChange(arg) {
    var selected = $.map(this.select(), function (item) {
        return $(item).text();
    });
}

This example from Telerik might help: http://demos.telerik.com/aspnet-mvc/grid/events

Share:
11,086
GANI
Author by

GANI

Updated on June 04, 2022

Comments

  • GANI
    GANI almost 2 years

    My grid is

        @(Html.kendo().Grid<StudentViewModel>()
           .Columns( x=>
           {
            x.Bound( y => y.StudentId);
            x.Bound(y => y.SubjectId);
            x.Bound(y => y.Name);
          })
    

    here when user clicks on "StudentId" or "SubjectId" cell in those columns want to show a popup, how to get the cell click event and verify that is the right column. How to get the cell click event ?

  • GANI
    GANI almost 10 years
    I didn't understand, where to subscribe to this Onchange event, can you elaborate please