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

Databinding decimal problem

1 Answer 208 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
StevenDale
Top achievements
Rank 2
StevenDale asked on 31 Mar 2011, 06:19 PM

I have several places in my application where I bind decimals to textbox controls. I have UpdateSourceTrigger=PropertyChanged so that my buttons attached to commands enable when a valid value is entered so the user does not have to click out of the textbox to enable the save button.

Problem 1: Lets say you have the value 24.05 in the text. Now place the cursor between the 4 and the decimal place holder. Backspace 2 times and type in the number 8. Instead of 8.05 you get 80.05. Our users are used to being able to type without looking and expect what they type to be correct.

Problem 2: Type in the value .234. Instead of .234 you get 0.342.

I know I could solve the problem by changing UpdateSourceTrigger=PropertyChanged to UpdateSourceTrigger=LostFocus but this will cause the user to have to tab out of the control or click inside of another control to enable the save button which defeats the purpose of Commanding.

Can I use the MaskedInput Control to fix this? I tried it with the example from your Sample Project under Masked TextBox -> NumericMask  labeled: "5 Digits after the decimal point" but that does not handle problem #1. If you don't have a control to handle this, do you know of a workaround for this?

1 Answer, 1 is accepted

Sort by
0
Alex Fidanov
Telerik team
answered on 04 Apr 2011, 12:18 PM
Hi Billy Jacobs,

This is a known issue for the RadMaskedTextBox, however, the same scenario is resovled with the RadMaskedNumericInput. I am not sure which sample you tried for the numeric input control, but there is none with the description you mentioned. Please try using this one.

Regarding problem 2, you can also use the masked numeric input. With the current version, you would have to enter 0.234 to get this behavior, however as of today's (or next week's) internal build, it would be possible to enter only ".234".

Best wishes,
Alex Fidanov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
StevenDale
Top achievements
Rank 2
Answers by
Alex Fidanov
Telerik team
Share this question
or