RadMaskedEditBox enter currency values without currency symbol without currency symbol

9 posts, 1 answers
  1. Catalin
    Catalin avatar
    18 posts
    Member since:
    Jun 2008

    Posted 25 Sep 2012 Link to this post

    Hello,

    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.

  2. Answer
    Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 28 Sep 2012 Link to this post

    Hello Catalin,

    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
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Catalin
    Catalin avatar
    18 posts
    Member since:
    Jun 2008

    Posted 28 Sep 2012 Link to this post

    Thank you Stefan, thet did the trick.
  5. Mark
    Mark avatar
    32 posts
    Member since:
    Jan 2012

    Posted 09 Aug in reply to Stefan Link to this post

    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.

  6. Catalin
    Catalin avatar
    18 posts
    Member since:
    Jun 2008

    Posted 09 Aug in reply to Mark Link to this post

    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.

     

  7. Hristo
    Admin
    Hristo avatar
    716 posts

    Posted 10 Aug Link to this post

    Hello,

    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
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
  8. Catalin
    Catalin avatar
    18 posts
    Member since:
    Jun 2008

    Posted 10 Aug in reply to Hristo Link to this post

    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.

  9. Mark
    Mark avatar
    32 posts
    Member since:
    Jan 2012

    Posted 11 Aug in reply to Hristo Link to this post

    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.

  10. Hristo
    Admin
    Hristo avatar
    716 posts

    Posted 15 Aug Link to this post

    Hello,

    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 this thread.

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo Merdjanov
    Telerik by Progress
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms. For more information check out this blog post and share your thoughts.
Back to Top
UI for WinForms is Visual Studio 2017 Ready