MaskCurrencyInput behavior for data entry

2 posts, 0 answers
  1. Eric
    Eric avatar
    6 posts
    Member since:
    Dec 2011

    Posted 05 Jan 2012 Link to this post

    I'm having trouble getting the behavior right with the RadMaskedCurrencyInput control (WPF).  I'm designing an accounting application so there will be a great deal of 10-key data entry of numbers.  Here's what I want to do:

    (User is entering value of $12.34)
    1. Control gains focus, cursor is all the way to the right.
    2. User types 1, value changes to 0.01, even if a value exists.(current behavior matches this)
    3. User types 2, value changes to 0.12   (current behavior: value changes to 0.02)
    4. User types 3, value changes to 1.23   (current behavior: value changes to 0.03)
    5. User types 4, value changes to 12.34 (current behavior: value changes to 0.04)

    Can someone tell me how to achieve this?

    I've tried many combinations of Selection On Focus, Spin Mode, Input Behavior (Insert/Replace), both in the example explorer and in my code, and haven't found one that works.  I believe I could get this to work except that when the cursor is all the way to the right and the user types, the textbox does not shift the contents to the left - it simply replaces the rightmost digit with the typed number.

  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 10 Jan 2012 Link to this post

    Hi Eric,

    You can create a custom control that derives from the RadMaskedCurrencyInput control to implement the desired behavior. In this custom control you'll need to override the InputBehaviorResolved to return always Insert InputBehavior.

    I attached a sample project demonstrating this approach. Give it a try and let me know if it works for you.

    Regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top