RadMaskedCurrencyInput can't input the first character after decimal separator

4 posts, 0 answers
  1. knata
    knata avatar
    2 posts
    Member since:
    Mar 2011

    Posted 12 Jul 2012 Link to this post

    Hi,
    I have a issue with property "Culture" of RadMaskedCurrencyInput. Example:
    I have a RadMaskedCurrencyInput in xaml
    <telerik:RadMaskedCurrencyInput Grid.Column="3"
    x:Name="mciUnitPrice"
    Grid.Row="1"
    Height="22"
    Margin="8,4,36,0"
    TabIndex="105"
    />
    and these are codes in vb file
    Dim oCurrentNFI As NumberFormatInfo = System.Threading.Thread.CurrentThread.CurrentCulture.NumberFormat
     
    <Here is codes for customize NumberFormatInfo>
     
    System.Threading.Thread.CurrentThread.CurrentCulture.NumberFormat = oCurrentNFI
    System.Threading.Thread.CurrentThread.CurrentUICulture.NumberFormat = oCurrentNFI
     
    mciUnitPrice.Culture = Thread.CurrentThread.CurrentUICulture
    when i run my app, i can't input any character at first position after decimal separator.

    tks
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 17 Jul 2012 Link to this post

    Hi Knata,

    I wasn't able to reproduce this issue locally. Can you please send us a sample project demonstrating the issue? Also, can you please make sure that the project explicitly sets the number format setting of the culture? Because the default culture settings on your machine might be different from those on the machine I'm testing on and this may be the reason why I can't reproduce the issue locally.

    Also, we are aware of an issue with changing the Culture.NumberFormat.Separator - this causes an incorrect grouping and incorrect display. This is why if in your application, the separator is changed, then this might be the cause for the incorrect behavior you described.

    Greetings,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. knata
    knata avatar
    2 posts
    Member since:
    Mar 2011

    Posted 18 Jul 2012 Link to this post

    Hi,
    I think there are problems in my codes when i customize NuberFormatInfo.
    System.Threading.Thread.CurrentThread.CurrentCulture = New CultureInfo("vi-VN")
    System.Threading.Thread.CurrentThread.CurrentUICulture = New CultureInfo("vi-VN")
     
          Dim oCurrentNFI As New NumberFormatInfo
          With oCurrentNFI
              .CurrencyGroupSeparator = "."
              .CurrencyDecimalSeparator = ","
              .CurrencyDecimalDigits = 2
              .CurrencyNegativePattern = 1
              .CurrencySymbol = String.Empty
          End With
     
          System.Threading.Thread.CurrentThread.CurrentCulture.NumberFormat = oCurrentNFI
          System.Threading.Thread.CurrentThread.CurrentUICulture.NumberFormat = oCurrentNFI
          mciInput.Culture = Thread.CurrentThread.CurrentUICulture

    is here problem: .CurrencySymbol = String.Empty ?
    I have more question for teleik Q2 2012: Can i input negative with RadMaskedCurrencyInput?
    Thanks,
  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 20 Jul 2012 Link to this post

    Hello Knata,

    Thank you for getting back to us. Indeed the RadMaskedCurrencyInput expects a currency symbol, so if you want to specify a culture with NumberFormat settings that don't use a currency symbol, it's better to replace the MaskedCurrencyInput control with a MaskedNumericInput control.

    If, on the other hand, you need a MaskedCurrencyInput control, but you don't want it to display a currency symbol, then a better approach is not to change the Culture.NumberFormat settings but to set the MaskedCurrencyInput.IsCurrencySymbolVisible property to False.

    Also you can enter negative numbers in the control, but there is a known issue in the 2012.2.607 version of the controls that doesn't allow entering negative values in both the MaskedCurrencyInput and the MaskedNumericInput. However, this issue is already fixed and you can test it with the latest internal build. In the meantime, you can define Minimum and Maximum values for the control to workaround the issue like this:
    <telerik:RadMaskedCurrencyInput
            xmlns:ext="clr-namespace:Telerik.Windows.Controls.MaskedInput;assembly=Telerik.Windows.Controls.Input"
            ext:MaskedInputExtensions.Maximum="2147483647"
            ext:MaskedInputExtensions.Minimum="-2147483648" />

    I hope this information will help you.

    Kind regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top