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

RadTreeView key commands

1 Answer 46 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Miroslav
Top achievements
Rank 1
Miroslav asked on 08 Oct 2012, 11:15 AM
Hi i have a problem, after executing  my key commands in the tree the tree navigation with the arrow keys stops working.If i click on any element with the mouse it works but after the execution it stops.The thee has focus the commands work if you use them more than once.
public void OnKeyDown(BehaviourArgs<KeyEventArgs> param)
        {
            RadTreeView tree = (((System.Windows.RoutedEventArgs)(param.Args)).OriginalSource) as RadTreeView;
            if (tree == null)
                tree = ((Telerik.Windows.Controls.RadTreeViewItem)(((System.Windows.RoutedEventArgs)(param.Args)).OriginalSource)).ParentTreeView;


            switch (param.Args.Key)
            {
                case (Key.V):
                    if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
                    {
                        if (_userDefienedFieldsForCopy.Count > 0)
                        {
                            selectedItems = tree.SelectedItems;
                            this.Paste();
                            
                        
                        }


                    }
                    break;
                case (Key.C):
                    if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
                    {
                        selectedItems = tree.SelectedItems;
                        this.Copy();
                      
                    
                     }
                    break;
}
}

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 11 Oct 2012, 09:05 AM
Hello,

Could you please check if the focus is inside the TreeView after the execution of your custom commands. TreeView has to have the focus in order to provide correct behavior for arrow key navigation.
If the focus is inside the TreeView, could you please provide us a sample project simulating the issue?

Greetings,
Hristo
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
TreeView
Asked by
Miroslav
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or