DecimalUpDown, DoubleUpDown input value format

Sep 1, 2011 at 9:13 AM
Edited Sep 7, 2011 at 6:23 AM

Hi everyone.

I have some trouble with DecimalUpDown, DoubleUpDown user controls. It turns out that a user can enter a value that does not fit the format.

Is there a way to format the entered value ?


1) Object Orderitm has double property Rate.

2) I'm described DecimalUpDown controls with binding to Value property.

<wpfextended:DecimalUpDown Value="{Binding Path=Orderitm.Rate , Mode=TwoWay}" FormatString="F2" Increment="0.01" Maximum="1" Minimum="0" />

FormatString property only defines a display format and has no effect on the value entered by the user. I.e. user can input value = 0.111154, variable Orderitm.Rate =
0.111154 (but I need Orderitm.Rate = 0.11) and displayed value will be 0.11.

Is it possible to prevent a user from entering numbers (format input value)? Only using its own converter?
Another problem, which is associated with this - Text input numbers do not meet the current cultural info.
At the same
value after the input is reset to the old value.
Are there any opportunities to realize the logic of the ban on entering characters not used in your cultural info(for example, as is done in the RadNumericUpDown by Telerik).


Mar 8, 2012 at 11:43 PM

Hi, all,

I was wondering if this was ever addressed.  It doesn't appear as if there is an option to LIMIT the number of characters entered after the decimal place... so, for example, if the Format of the DecimalUpDown is set to F2, the user is still allowed to enter in a value of, let's say, 123.4567.  The current functionality of the control then shows the value as 123.46 (rounded, mind you), but the value that was entered is set to the bound value property.  So, even though the user SEES that the value they entered was 123.46, what actually gets stored would be the entire number w/ 4 decimal places... does that seem odd to anyone else?  Is there a way for the current functionality to prevent them from entering in anymore decimals that what is provided by the format... maybe this there is property that I'm missing?

The entire toolkit is just a great project.  I'm so glad the community is acive.  Also, I was wondering, if someone wanted to contribute to this project, do they have to do something special?

Thanks for all the quality work!!!!