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

    <TelerikPresentation:RadTreeView.InputBindings>
    <KeyBinding Key="Enter" Command="{Binding ItemOpenCommand}"
    CommandParameter="{Binding SelectedItem, ElementName=tvMessageSectors}"
    />             </TelerikPresentation:RadTreeView.InputBindings>
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 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. UI for WPF is Visual Studio 2017 Ready
  4. Sebastien
    Sebastien avatar
    3 posts
    Member since:
    Apr 2014

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

    Is the problem still present in the latest release of Telerik?
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 15 Mar 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)));
    #endif

    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. 

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