How to hook to client keyboard events with Telerik’s DropDownList

So, you have same problem as me, how to subscribe to clients keyboard events with Telerik’s DropDownList control for ASP.NET MVC? 🙂

Unfortunatelly, there is no out of box event for this yet, but it’s not that hard, we just need some jQuery magic.

This is the code :


$('#id-of-your-combobox').parent().keydown(function (e) {
alert('Handler for .keydown() called.');
});

Please be aware, that if you are using combo box in Grid (in Telerik’s MVC Grid, like I do), then you need to execute this code in OnEdit event handler, since combo box object exists only when some row is in edit state.

If you have any questions, feel free to ask.

Hope this helps, at least to save you some time.

One thought on “How to hook to client keyboard events with Telerik’s DropDownList

Leave a Reply

Your email address will not be published. Required fields are marked *