This seems like such a simple thing, I'm suprised that its not something included in the Telerik Silverlight control set.
We've got a NumericUpDown, which as far as I can see only has one main use, and thats setting the quantity on an order form. Its possible to use for some other things, but mostly becomes a hinderance rather than an assistance to users.
We also have masked edit, which is occasionally useful for phone numbers and social security numbers etc, but is extremely counter-intuitive when trying to use it for currency.
The old RadNumeric box did exactly what we need - automatically prevented the user from entering rubbish, displayed the currency when in view and hid it during entry, accepted decimal point, let us speficy number of digits, etc.
Please... can we have one back?
11 Answers, 1 is accepted
Can you elaborate a little bit more what is wrong with the currency support in masked textbox. We plan refactoring on this control and we want to make sure that we will address the proper problems.
All the best,
the Telerik team
Really, I dont think that currency is a good candidate for masked edit at all.
If I am entering a dollar value, I expect to be able to click into the cell, and just type either just the dollars, or a the dollars, decimal point and cents.
The idea of having to click into the cents part of the mask to enter that, or the dollar section to enter dollars, is just not the way that just about any web sites expect, and is not what I'd expect as a user. Nor do I want to see a mask displayed when the field is blank - again its not what I epxect, I'd rather see $0.00 (or whatever your currency is).
When I have implemented this in my own code, these are my requirements:
1) I format the cell as currency when I display it - say $1,000.00. Not a mask as such, just formatted text.
2) When the control gets focus I swap it to 1000.00 (no currency sign), and I accept whatever the user types, as long as its a valid currency. I would never expect them to type the dollar sign. I usually select the whole text as well so the user can just replace what is there.
3) I simply ignore any invalid characters, maybe flashing the border red (take a look at your ajax RadNumericTextBox in currency mode)
4) When the control loses focus, I again refromat it as currency.
As I said, the Ajax version was the perfect implementation of this, rather than trying to bend masked edit into it. Dollars just are not a mask, they are a specially formatted decimal number, of variable length. Two different things.
Thank you for your valuable input. We will consider adopting the best practices from the Ajax input into the Silverlight.
the Telerik team
I need to only allow posative numbers in my masked edit box for a silverlight application, or allow posative and negative numbers.
Is there a workaround for this?
We have recently released a new suite of MaskedInput controls and you can examine their behavior in this demo. The suite contains a MaskedNumericInput, MaskedCurrencyInput, MaskedDateTimeInput and MaskedTextInput controls. Further information about their features and funstionality you can find in our online documentation.
I also attached a sample project illustratung how to take advantage of the MaskedInputExtensions class that allows you to define a minimum value of the MaskedNumericInput thus contraining the input to positive digits only.
the Telerik team
Expectation is textbox needs to validate only numberic values with dot and comma seperator except special char.
I used Radmaskedtextbox, radmaskednumericinput both are not satisfy.
If we set mask=n means not able to enter decimal values if Mask=n2 means it always show precision
User can type decimal values and also if load integer means it should not display precision except user entry.
Could you please elaborate more on the exact features that you need in MaskedInput controls ? Which of them are correctly working for you in MaskedTextBox?
By default, double numbers should be displayed in MaskedNumericInput and decimal should be used with MaskedCurrencyInput control. Also, do you mean you need a non-fixed number of digits after the decimal point ?
Our main goal is to have a MaskedInputControls suite that completely replaces the old MaskedTextBox. Your feedback on this topic will be highly appreciated.
All the best,
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
Please could you shed some light on this behavior. I'm trying the demo http://demos.telerik.com/silverlight/#MaskedInput/MaskedNumericInput
and of course I want to enter a complete new digit so I erase everything in this control and start to type to enter 123.12
but each digit I type overrides the last one. Seems very buggy. Also I tried the control myself in my app and it does the same for the latest build
Am I missing something ?
I'm also wondering if there's way to not have the zero put automatically there as the user click on the control and the caret is behind the zero of the thousands and when starting to type his/her number, the zero is still there in front and it bugs people
We are sorry to hear you find it buggy to work with the MaskedInputControls. But please have in mind that this suite of Controls has a large set of properties, extension properties (turning on behaviors), events which can help you achieve the exact requirements you have. That is why we want to ask you for the exact steps you perform in our demos and the exact behavior you need. We did not manage to understand the issues with the typing and the zeros. In the numeric input demo pressing clear button will move the caret on left of the decimal point and you will be able to type 123 then pressing "." will move the caret on the right of the decimal point and you will be able to type 123.12 for instance.
As for the zeros - could you please again share with us the exact steps you perform and what yo expect?
If you uncheck the AutoFilllZeros button (this sets AutoFillZeros = False) the zeros will not be automatically inserted in empty spaces between your input and the decimal point. I hope this might be helpful.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>