I need to react to arrows keys in document host, but I discovered that arrows key, in docking, moves the focus on the various parts of docking areas: can I disable this interaction? Thank you
I have tested this scenario, however, the control present in a RadPane that is part of the DocumentHost correctly receives the keyboard input, rather than moving the focus to other parts of RadDocking. I have attached the sample project, so, could you give it a try and let me know if I am missing something of importance?
The following gif shows the result that is present on my end:
With your sample project I can reply the situation in all the tab but the document host: if you click the right or left arrow, you resize the area. It is that the behaviour that I want to disable. In the document host I replaced your listbox with an image and then also in the document host I get the behaviour (note that image is not the control that I use in my application, but it has similar properties about the keyboard interaction). Luigi
Stenly
Telerik team
commented on 30 Dec 2022, 02:32 PM
Would it be possible to give the PreviewLostKeyboardFocus event of RadDocking a try?
In the scenario present in the sample project, clicking on the left/right arrows will move the focus to a RadGridResizer element, which will resize the areas. With the mentioned event, you could prevent the focus from moving by handling the event if the e.NewFocus is of type RadGridResizer.
privatevoidRadDocking_PreviewLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
if (e.NewFocus is RadGridResizer)
{
e.Handled = true;
}
}
Hello Luigi,
I have tested this scenario, however, the control present in a RadPane that is part of the DocumentHost correctly receives the keyboard input, rather than moving the focus to other parts of RadDocking. I have attached the sample project, so, could you give it a try and let me know if I am missing something of importance?
The following gif shows the result that is present on my end:
Hi Stenly
Thank you for your answer.
With your sample project I can reply the situation in all the tab but the document host: if you click the right or left arrow, you resize the area. It is that the behaviour that I want to disable.
In the document host I replaced your listbox with an image and then also in the document host I get the behaviour (note that image is not the control that I use in my application, but it has similar properties about the keyboard interaction).
Luigi
Would it be possible to give the PreviewLostKeyboardFocus event of RadDocking a try?
In the scenario present in the sample project, clicking on the left/right arrows will move the focus to a RadGridResizer element, which will resize the areas. With the mentioned event, you could prevent the focus from moving by handling the event if the e.NewFocus is of type RadGridResizer.
private void RadDocking_PreviewLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e) { if (e.NewFocus is RadGridResizer) { e.Handled = true; } }
Yes,
I try and I achieved what I need.
Thank you
Luigi