RadDocking keyboard arrows

1 Answer 49 Views
Docking
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Deltaohm asked on 23 Dec 2022, 09:01 AM

Hi,

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 

Luigi

Stenly
Telerik team
commented on 27 Dec 2022, 10:52 AM

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:

Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
commented on 27 Dec 2022, 02:57 PM

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

 
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.

private void RadDocking_PreviewLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
    if (e.NewFocus is RadGridResizer)
    {
        e.Handled = true;
    }
}
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
commented on 24 Jan 2023, 10:22 AM

Yes,

I try and I achieved what I need.

Thank you

Luigi

1 Answer, 1 is accepted

Sort by
0
Accepted
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
answered on 24 Jan 2023, 10:23 AM

Yes,

I try and I achieved what I need.

Thank you

Luigi

Tags
Docking
Asked by
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Answers by
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Share this question
or