New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
OnClientKeyPressing
The OnClientKeyPressing client-side event occurs when a combobox receives the focus and the user presses a key.
The event handler receives two parameters:
-
The instance of the combobox firing the event.
-
An eventArgs parameter containing the following properties and methods:
- get_domEvent() returns the DOM event object. You can get the altKey, shiftKey, ctrlKey and keyCode from the DOM event object.
This example below uses the OnClientKeyPressing event to execute custom JavaScript when the user tabs out:
ASPNET
<script language="javascript" type="text/javascript">
function HandleKeyPress(sender, eventArgs)
{
if (eventArgs.get_domEvent().keyCode == 9) {
// handle tab out
}
}
</script>
<telerik:radcombobox
id="RadComboBox1"
runat="server"
onclientkeypressing="HandleKeyPress">
</telerik:radcombobox>