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

Numeric copy/paste problem(comma/point)

2 Answers 220 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Dirk
Top achievements
Rank 1
Iron
Dirk asked on 21 Sep 2011, 01:08 PM
In Germany we use a comma to separate a number: 12,45 (not 12.45).
If I copy and paste a number with a comma in a the RadMaskedNumericInput control, the pasting fails: I get 1245 (without comma).
If I paste 12.45 it works and I get 12,45, but this doesn't solve my problem in Germany.

If I use the RadMaskedTextBox (numeric style) I don't have this problem, but the MaskedTextbox hasn't the possiblities (like Watermarktext) like theRadMaskedNumericInput control.

Do you have a solution, how I can excahnge the comma with a point on the fly so that the pasting succeed?

Regards
Dirk

2 Answers, 1 is accepted

Sort by
0
Accepted
Tina Stancheva
Telerik team
answered on 26 Sep 2011, 03:10 PM
Hi Dirk,

Thank you for reporting this issue - I logged it in our PITS, where you can track its progress. Can you please tell us how would you expect the control to behave? Basically what we can do is allow the control to paste floating-point numbers depending on its culture. For example if you paste a number with comma separator in a MaskedNumericInput control with culture where the decimal separator is a comma, the value will be properly pasted. However, pasting a number with point separator in a MaskedNumericInput control with culture where the decimal separator is a comma won't paste the number as a floating-point number. And vice versa - pasting a floating-point number with comma separator in a MaskedInput control with culture where the point character is the decimal separator, won't work

Is this the expected behavior of the control for you? Your feedback on the matter will be highly appreciated.

In the meantime you can create a custom control deriving from the MaskedNumericInput control to change the default paste behavior of the control. I attached a sample project demonstrating this approach. Please have a look at it and let us 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 >>

0
Dirk
Top achievements
Rank 1
Iron
answered on 29 Sep 2011, 10:02 AM
Thank you Tina,
your workarouand is working.

And yes, copy and paste should only work within the same culture.
'Cross culture' copy and paste is not necessary. And if it is needed it is still posible to use your workaraound.
In our Silverlight application we want to be able to copy and paste numbers from Excel to the RadInputNumericControl (Culture de-DE)

Regards
Dirk
PS: I have an other problem :
http://www.telerik.com/community/forums/silverlight/maskedinput/wrong-behaviour-with-mask-9-5.aspx
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Dirk
Top achievements
Rank 1
Iron
Answers by
Tina Stancheva
Telerik team
Dirk
Top achievements
Rank 1
Iron
Share this question
or