Masked Textbox

Editors for WPF Forum

The latest build of this product (v24.1.4) was released 2 months ago, which was before this thread was created.
Posted 1 month ago by Burkhard Lettner - PROCAM Software, Systems & Services GmbH
Version: 24.1.4
Avatar

Hello,

I have a Masked Textbox using this mask Binding to a double property

\\d+[,]\\d{2}

When I enter "10,00" as value - save the value and reaload the form, "10," is shown

The zeros at the end are missing.

Is there a way to fill this up so that the value is shown in the correct way?

Thx
Burkhard

Comments (2)

Posted 1 month ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

If you display the prompt characters, do you see two prompt dots right after the ","?  If so, the MaskedTextBox control is meant to match text values against a text mask.  The control doesn't really know if the mask is for a number, email address, or any other data.  When a number like 10.00 is ToString()'ed, it just converts to text "10".  You could possibly work around this by making a value converter that when converting the Double to a String will use the "N2" format.

If you are trying to edit a Double value, the better way to do it would likely be to use our DoubleEditBox control with an "N2" Format.  That will bind directly to a Double value, the control is made for editing Doubles, and it will show the decimals with that format set.


Actipro Software Support

Posted 1 month ago by Burkhard Lettner - PROCAM Software, Systems & Services GmbH
Avatar

Thanks for the quick answer - this would have been an easy way to support different entry types on my dynamic forms.
But I will create templates where I use different controls based on the datatypes of the property.

Add Comment

Please log in to a validated account to post comments.