Remove a keyboard shortcut

3 posts, 1 answers
  1. Roman
    Roman avatar
    40 posts
    Member since:
    Jan 2009

    Posted 27 Jul 2010 Link to this post

    Hi

    I couldn't find any information on how to manage the RadListBox's keyboard shortcuts. How can I remove e.g. the "Del"-Shortcut for deleting an item?

    Thanks in advance
    Best
    Roman
  2. Answer
    Yana
    Admin
    Yana avatar
    4591 posts

    Posted 30 Jul 2010 Link to this post

    Hi Roman,

    I suggest you subscribe to OnClientDeleting event of the listbox:

    <telerik:RadListBox ID="lbxGroup" runat="server" Width="350px" TabIndex="1" AccessKey="y"
     AllowDelete="true" OnClientDeleting="clientDeleting">
        <ButtonSettings></ButtonSettings>
        <Items>
            <telerik:RadListBoxItem runat="server" Text="RadListBoxItem1" />
            <telerik:RadListBoxItem runat="server" Text="RadListBoxItem2" />
            <telerik:RadListBoxItem runat="server" Text="RadListBoxItem3" />
        </Items>
        <EmptyMessageTemplate>
            No data
        </EmptyMessageTemplate>
    </telerik:RadListBox>

    and in its handler cancel the event if the "del" button is clicked:

    function clientDeleting(sender, args) {
        if(args.get_domEvent().keyCode == 127)
            args.set_cancel(true);
    }

    Kind regards,
    Yana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Roman
    Roman avatar
    40 posts
    Member since:
    Jan 2009

    Posted 02 Aug 2010 Link to this post

    Hello Yana

    I didn't have the idea of using keyCodes, thanks for your answer.

    Kind regards
    Roman
Back to Top