This is a migrated thread and some comments may be shown as answers.

InputKeyBinding Issue

3 Answers 181 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
irfan
Top achievements
Rank 1
irfan asked on 29 Jul 2011, 01:41 PM
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>

3 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 03 Aug 2011, 06:02 PM
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 >>

0
Sebastien
Top achievements
Rank 1
answered on 10 Mar 2016, 10:47 PM
Is the problem still present in the latest release of Telerik?
0
Petar Mladenov
Telerik team
answered on 15 Mar 2016, 12:03 PM
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.
Tags
TreeView
Asked by
irfan
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Sebastien
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or