InputKeyBinding Issue

4 posts, 0 answers
  1. irfan
    irfan avatar
    3 posts
    Member since:
    May 2011

    Posted 29 Jul 2011 Link to this post

    We are using Prism 4.0 and MVVM pattern

    When we try to work with Enter key on RadTreeView Item, it does not invoke the ItemOpenCommand.

    Below code doesn't register ItemOpenCommand command

    <KeyBinding Key="Enter" Command="{Binding ItemOpenCommand}"
    CommandParameter="{Binding SelectedItem, ElementName=tvMessageSectors}"
    />             </TelerikPresentation:RadTreeView.InputBindings>
  2. Tina Stancheva
    Tina Stancheva avatar
    3299 posts

    Posted 03 Aug 2011 Link to this post

    Hi Irfan,

    This issue is caused by the fact that the RadTreeView internally handles the KeyDown event when the Enter key is hit. The event is handled when a RadTreeViewItem Items collection isn't empty. So the KeyBinding you define will work only on such RadTreeViewItems that have no child items.

    However, if you can give us more details about the scenario that you want to implement we will do our best to provide you with possible solutions.

    Best wishes,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  3. Sebastien
    Sebastien avatar
    3 posts
    Member since:
    Apr 2014

    Posted 10 Mar 2016 in reply to Tina Stancheva Link to this post

    Is the problem still present in the latest release of Telerik?
  4. Petar Mladenov
    Petar Mladenov avatar
    3136 posts

    Posted 15 Mar 2016 Link to this post

    Hello Sebastien,

    RadTreeView does not handle the Enter key since Q3 2011. Instead it uses CommandBindings:
    #if WPF
                CommandManager.RegisterClassInputBinding(treeViewType, new KeyBinding(RadTreeViewCommands.ToggleExpandCollapse, new KeyGesture(Key.Enter)));

    Enter key toggles the expand/collapse state of the selected item. However, if you have particular issue with the enter key functionality, please provide some further details about it in a new support thread. 

    Petar Mladenov
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top