Delete node by keybord button

5 posts, 0 answers
  1. Niclas Ahlqvist
    Niclas Ahlqvist avatar
    20 posts
    Member since:
    Nov 2008

    Posted 14 Oct 2011 Link to this post

    Do you have an example of deleting a node by keyboard button click?

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 14 Oct 2011 Link to this post

    Hello Niclas,

    You can achieve this by attaching OnClientKeyPressing  event. Here is a sample code which deletes the node on Delete key press.
    function OnClientKeyPressing(Sender, args)
         if (args.get_domEvent().keyCode() == 127)//Checking for delete key
               var node = args.get_node()

  3. Gotcha
    Gotcha avatar
    64 posts
    Member since:
    Sep 2009

    Posted 03 Aug 2012 Link to this post


    Is the Delete Key 127 or 46 ?
    I did some googling... and im getting 46... 
  4. Helen
    Helen avatar
    1052 posts

    Posted 06 Aug 2012 Link to this post

    Hi Cyril,

    Actually they both should work for the "Delete" key:

    Kind regards,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  5. Vsoni
    Vsoni avatar
    9 posts
    Member since:
    Oct 2013

    Posted 20 May 2014 in reply to Niclas Ahlqvist Link to this post

    <script type="text/javascript" language="javascript">
    function detectspecialkeys(e) {
                var evtobj = window.event ? event : e;            
                if (evtobj.keyCode == 46) {                                     
    document.onkeyup = detectspecialkeys

Back to Top