Negative value in MaskedInput

2 posts, 0 answers
  1. jeya
    jeya avatar
    20 posts
    Member since:
    May 2011

    Posted 17 Nov 2011 Link to this post


    I am using MaskedInput control for currency value. I want to set a negative currency value in the masked input control. I get () in the control when I type - symbol. How to set mask which accepts negative value for currency type.

  2. Petar Mladenov
    Petar Mladenov avatar
    3154 posts

    Posted 22 Nov 2011 Link to this post

    Hello Jeya,

    This is the default CurrencyNegativePattern used in "en-Us" Culture. You can view the possible negative patterns here in this msdn help article. What you could do is to change the default "en-US" culture used like so:

    <telerik:RadMaskedCurrencyInput Width="300" Height="30" x:Name="input" />
    public MainWindow()
              CultureInfo cultureInfo = new CultureInfo("en-US");
              NumberFormatInfo numberFormat = new NumberFormatInfo();
              numberFormat.CurrencyNegativePattern = 8;
              numberFormat.CurrencyPositivePattern = 1;
              numberFormat.CurrencySymbol = "$";
              cultureInfo.NumberFormat = numberFormat;
              this.input.Culture = cultureInfo;
    You can also find this realized in the attached solution. Feel free to ask if you need further assistance. Kind regards,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top