I have a few RadButton controls where I would like a different command to execute if the user "long presses" on the button.
For instance a single simple click would do 1 thing and a long click and hold then release would do something else.
How would I do that?
2 Answers, 1 is accepted
0
Accepted
Dinko | Tech Support Engineer
Telerik team
answered on 17 Feb 2021, 09:35 AM
Hello,
To achieve your scenario you can use the PreviewMouseDown and PreviewMouseUp events of the RadButton. In the PreviewMouseDown event handler you can start a timer. In the PreviewMouseUp you can check how long the timer have run and if it is more than a second you can execute your long press logic.
You can modify the timer so it fit in your application.
Regards,
Dinko
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/.