New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Disable the built-in shortcuts of RadEditor

Description

The sample below shows how to disable the RadEditor built-in shortcuts

Solution

In specific scenarios, it is needed to disable the built-in shortcuts of RadEditor. The code below demonstrates how to achieve the desired behavior using the editor's OnClientCommandExecuting event. Note that when a command is called by a shortcut (not by a tool) the get_tool() method returns an undefined string e.g.

<script type="text/javascript">     
    function OnClientCommandExecuting (editor, args)     
    {     
        if (args.get_name() && !args.get_tool())     
        {     
            args.set_cancel(true);     
        }     
    }     
</script>     
<telerik:RadEditor      
    ID="RadEditor1"      
    OnClientCommandExecuting="OnClientCommandExecuting"       
    runat="server">     
</telerik:RadEditor> 
In this article