I want to set focus to the ui element(ui element is popup which contains devexpress grid) when I press down arrow key in the text box. I would like it to work purely on XAML side or by using MVVM. will this work. pls let me know the way i can accomplish this.
<KeyBinding Key="Down" FocusManager.FocusedElement="{Binding ElementName=PART_GridControl}"/>
i was using code behind like this but i want to implement mvvm.i want to change the focus from text box to the grid control, when i press down arrow key in text box –
private void text_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Down || e.Key == Key.Up || e.Key == Key.Left || e.Key == Key.Right)
{
PART_GridControl.Focus();
}
}