This is a migrated thread and some comments may be shown as answers.

RadMaskedCurrencyInput can't input the first character after decimal separator

3 Answers 94 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
knata
Top achievements
Rank 1
knata asked on 13 Jul 2012, 02:04 AM
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

3 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 17 Jul 2012, 12:15 PM
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.

0
knata
Top achievements
Rank 1
answered on 19 Jul 2012, 01:39 AM
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,
0
Tina Stancheva
Telerik team
answered on 20 Jul 2012, 10:57 AM
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.

Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
knata
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
knata
Top achievements
Rank 1
Share this question
or