This is a migrated thread and some comments may be shown as answers.

MaskCurrencyInput behavior for data entry

1 Answer 48 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 05 Jan 2012, 08:36 PM
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.

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 10 Jan 2012, 04:57 PM
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 >>

Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Eric
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or