In an application I need to enter some large numbers and the client wants to format the number as he types (add currency, thousands separator,etc). I tried to use RadMakedEditBox with the "f" mask, it does not respect culture, I tried using "c" mask, it kinda works but I need to get rid of the currency symbol. With the "c" mask I can change the currency symbol but I am unable to change it to String.Empty as I wish - the control crashes (the closest thing is to set " " - a single space - but it's not very pretty, the client does not accept that).
Is there any way to format the value using culture parameters without currency sign? I also tried working with "p" format but I didn't find a way to hide the percent sign. I seen another thread with a suggestion for using a spinner, that is not good for me.
Thank you.
8 Answers, 1 is accepted
Thank you for writing.
You can use the "n" mask which is for number and will format the entered number while typing. More information about numeric masks is availalbe here: http://www.telerik.com/help/winforms/editors-maskededitbox-numeric-masks.html.
I hope this helps.
Regards,
Stefan
the Telerik team
Hi,
I know this is an old post, but I wonder if I could get a little more info on this?
I am looking for exactly the behaviour requested, currency without the currency symbol. If I use n (or n2) I don't get the forced decimal places displayed like a currency, so 4.00 is displayed as 4
If I use f2 I get 4.00, however I really want the value grouping you get with currency and "n" masks for usability.
I have tried custom masks (#, etc.) but it doesn't look like these are supported.
Is it possible to get a value with static decimal places and value grouping:
1,222.30
Many thanks,
Mark.
Hello Mark,
We ended by using currency mask and overriding the current culture currency symbol to return a single space (something like customCulture.NumberFormat.CurrencySymbol = " "; ).
Like as I said in the original post, it's not very pretty (we have a space instead of currency symbol) but this is acceptable for my client. You can also try to set the CurrencySymbol to en empty string (I think that will be the ideal situation for you), maybe your version of telerik controls allows this scenario.
Have fun,
Catalin.
Thank you for writing.
I think that setting the MastType to Numeric and specifying "N" as your Mask could bring the desired result:
public
Form1()
{
InitializeComponent();
this
.radMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Numeric;
this
.radMaskedEditBox1.Mask =
"N"
;
}
I am also sending you a gif file showing how the masked edit box looks on my end.
I hope this helps. Please let me know if you need further questions.
Regards,
Hristo Merdjanov
Telerik by Progress
Hello Hristo,
As I said in the original post, "f" and apparently "N" masks does not respect culture settings, your example works for us-english and likes cultures but not for french for example.
Am I wrong?
Best regards,
Catalin.
Hi,
This does work OK for the Mask during data entry, however when I exit the textbox the .00 are not displayed.
I need the .00 to persist for display.
Thanks.
Mark.
Thank you for writing.
@Catalin. I have tested with a system having French regional settings as well with modifying the Culture property of RadMaskedEditBox to be French. I am sending you a short video showing the result on my end. Please note that I have tested with the latest version of the suite. In case you keep experiencing the issue please open up a support ticket and send us your project.
Mark`s question will be answered in the ticket he has opened. Once we reach to a solution I will also update thread.
I hope this helps. Should you have further questions please do not hesitate to write back.
Regards,
Hristo Merdjanov
Telerik by Progress