RadTreeView key commands

2 posts, 0 answers
  1. Miroslav
    Miroslav avatar
    5 posts
    Member since:
    May 2012

    Posted 08 Oct 2012 Link to this post

    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;
    }
    }
  2. Hristo
    Admin
    Hristo avatar
    352 posts

    Posted 11 Oct 2012 Link to this post

    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.

  3. DevCraft banner
Back to Top