This question is locked. New answers and comments are not allowed.
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;
}
}
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;
}
}