Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
315
MoveFocus with MaskedEditor
posted

I've implemented an attached property that when applied, will watch for the PreviewKeyDown event and call:

item.MoveFocus(

new TraversalRequest(FocusNavigationDirection.Next));

when it sees the Enter key pressed. This works great for standard WPF controls (i.e. TextBox, ComboBox, etc), however the Infragistics masked edit controls (i.e. XamDateTimeEditor, and XamCurrencyEditor) don't work as expected. When I hit the TAB key to put focus onto a masked edit control, it works correctly. However, when I call the above line of code, the SelectionsList element of the masked editor gets focus. When this happens, I'm unable to edit or call MoveFocus to get out of the control.

Any ideas? I've attached a file with the code I'm using to call MoveFocus.

Parents
No Data
Reply
  • 54937
    Offline posted

    Two things stand out to me. First, you're using the e.Source which is going to be the sender (the xamMaskedEditor in this case) and not the element with focus for which the event is being raised. You should probably be using e.OriginalSource. Second, you should probably be marking the event as handled or the control that is receiving the input focus is going to receive an Enter key press.

Children