Grid Header cancel OnClick for sorting

1 Answer 195 Views
Grid
Pingu
Top achievements
Rank 1
Iron
Iron
Pingu asked on 11 Jun 2022, 08:04 AM

Hi

If I have a column header ina  grid which is sortable, and in the header template I place a button, then clicking said button will perform whatever the button's onclick is as well as changing the sort of the column. I don't see a way to mark the click as handled, prevent it bubbling up and being handled a second time by the grid header. Is there a way to achieve this currently?

1 Answer, 1 is accepted

Sort by
0
Hristian Stefanov
Telerik team
answered on 15 Jun 2022, 09:33 AM

Hi Matthew,

I confirm there is an easy way to achieve the desired result. You can wrap the button in another element that stops the propagation of the said event.

Here is an example prepared for you in this REPL link to show the two behaviors and the difference.

Regards,
Hristian Stefanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Pingu
Top achievements
Rank 1
Iron
Iron
commented on 18 Jun 2022, 07:12 AM

Just what I needed, thanks. :) 
Tags
Grid
Asked by
Pingu
Top achievements
Rank 1
Iron
Iron
Answers by
Hristian Stefanov
Telerik team
Share this question
or