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
240
XamNumericEditor initial keyboard focus
posted

I am using the XamNumericEditor with a mask of {}{double:0.2} - no whole numbers, only 2 decimal places. When the control is initially loaded, the keyboard focus is on the left of the decimal and I have to move it over to the right of the decimal in order to gain keyboard up/down control over the value. Is there a way to set keyboard focus to the far right of the box initially?

  • 34830
    Offline posted

    Hello nwnerd,

    In order to do this, I would recommend that you utilize the SelectionStart property of the XamNumericEditor, and set it in the EditModeStarted event of that control. Currently, with a Mask of {}{double:0.2}, there would be a maximum indexed position of 3, and so if you use the following code, you can set the cursor to the right-side of the editor upon entering edit mode:

    private void numericEditor_EditModeStarted(object sender, Infragistics.Windows.Editors.Events.EditModeStartedEventArgs e)
    {
       numericEditor.SelectionStart = 3;
    }

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer