New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
OnClientContextMenuItemClicking
The OnClientContextMenuItemClicking client-side event occurs when the user clicks a menu item, but before the OnClientContextMenuItemClicked event fires. The event is called just prior to postback or url redirection and can be canceled.
The event handler receives parameters:
-
The TreeView instance that fired the event.
-
Event arguments with functions:
-
get_menuItem() retrieves a reference to the selected context menu item.
-
get_node() retrieves a reference to the clicked on node.
-
set_cancel() call this function to specify whether the event should be canceled (true) or not (false).
-
get_domEvent() retrieves the DOM event object of the item click.
The example below shows how to cancel the event if the text of the menu item is "Search"
ASPNET
<telerik:RadTreeView RenderMode="Lightweight" ID="RadTreeView1" runat="server" OnClientContextMenuItemClicking="ClientContextMenuItemClicking">
</telerik:RadTreeView>