New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
OnClientKeyPressing
The OnClientKeyPressing client-side event occurs when any key is clicked while the TreeView is having the focus:
The event handler receives parameters:
-
The TreeView instance that fired the event.
-
Event arguments with functions:
-
get_node() retrieves a reference to the node which is selected before pressing the key.
-
get_domEvent() retrieves the DOM event.
-
set_cancel() - call this function to specify whether the event should be canceled (true) or not (false). Canceling the event will for example stop the keyboard navigation.
The example below shows how to toggle the nodes upon clicking the Enter key:
ASPNET
<telerik:RadTreeView
ID="RadTreeView1"
runat="server"
LoadingStatusPosition="BeforeNodeText"
OnClientKeyPressing="OnClientKeyPressing">
...
</telerik:RadTreeView>