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
3220
XamNumericEditor: Mask input issue
posted

Hello,

when entering a floating point number, and the maximum integer digit count is reached, the next input number is entered in the fraction section. Is this a bug? And how can I avoid it.

E.g. the Mask is {double:2.2} and TrimFractionalZeros=True. The user wants to enter 123. By pressing these 3 numbers, the value would be 12.3 instead of 12. If the user dosn't look close enough he would enter a wrong number.

Parents
No Data
Reply
  • 34430
    Offline posted

    Hello Markus,

    I have been investigating into this behavior you are looking to achieve, and unfortunately, at the moment there is no built-in way to prevent this behavior in which you can essentially “skip” over the decimal point.

    In order to have this behavior, I would have to recommend handling the PreviewKeyDown event, as marking this event handled (e.Handled = true) will prevent that typed character from showing in the editor. Using this against the Mask, the Text, and the SelectionStart properties of the editor, you may be able to create a behavior that prevents the cursor from jumping the decimal point. The SelectionStart property is a zero based index that tells where the cursor is currently placed relative to the Mask.

    If you would like to see this behavior implemented in the XamNumericEditor and ValueEditor family of controls, I would recommend suggesting a new product idea for it at our WPF Ideas Site. This will place you in direct communication with our product management teams who plan and prioritize upcoming features and development based on community and user feebdback.

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

Children
No Data