Multiple Events for Row of Kendo Grid

1 Answer 64 Views
Button Checkbox Grid View
Brian
Top achievements
Rank 1
Brian asked on 18 Oct 2023, 02:40 PM

I am working with a Kendo grid on my MVC webapp.  The grid is bound by data passed to the View.  An event currently exists to load another grid when a row is selected/clicked on.  I have been tasked with adding a column that contains a checkbox based on a boolean value from the record in the dataset.  Until this point, everything is working.

My question is, how can I add an event to whenever the checkbox is checked and unchecked while keeping the event fro when a row is selected?  That is, if the user clicks on the row, I still want it to load the other grid based on the selected row, but if the user clicks on the checkbox in the row, I want it call a function to toggle the value and update the database (essentially call function changeFlag).  As a test, I put an alert() call in the function which runs when a row is selected, but the function never fires if I check/uncheck the checkbox.

I have some exposure to MVC, but Telerick/Kendo are completely new for me.  Any ideas, tips, or guidance would be greatly appreciated.

1 Answer, 1 is accepted

Sort by
0
Anton Mironov
Telerik team
answered on 23 Oct 2023, 07:55 AM

Hi Brian,

Thank you for the details provided.

In order to achieve the desired behavior, I would recommend using the Click Event handler of the checkbox.

In the Click Event handler, find the parent tr element and use the "select" method of the Grid:

Furthermore, the logic for opening the additional Grid could be used in a custom function that could be called either when a new row is selected, or if a checkbox is clicked.

I hope this information helps.

Kind Regards,
Anton Mironov
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the only REPL playground for creating, saving, running, and sharing server-side code.

Tags
Button Checkbox Grid View
Asked by
Brian
Top achievements
Rank 1
Answers by
Anton Mironov
Telerik team
Share this question
or