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

RadMaskedNumericInput Problem

3 Answers 544 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
crazy05
Top achievements
Rank 1
crazy05 asked on 11 Jun 2015, 08:15 PM

1) The below numeric input is always displaying 0 on screen load. I don't want to show anything. Latitude is defined as Decimal? is ViewModel.

2) I want this to allow only values between 32 and 38 upto 5 decimal digits.

How can I do this ? 

<telerik:RadMaskedNumericInput AllowInvalidValues="False" Value="{Binding Latitude, Mode=TwoWay}"  AutoFillZeros="False"  FlowDirection="LeftToRight" Placeholder=" "
                                              HorizontalAlignment="Left" AutoFillNumberGroupSeparators="false"  
                                              Mask="" SelectionOnFocus="SelectAll"  ></telerik:RadMaskedNumericInput>

3 Answers, 1 is accepted

Sort by
0
Milena
Telerik team
answered on 15 Jun 2015, 12:55 PM
Hello Ram,

I will try to answer all of your questions in the order they appeared. 

1) You can use EmptyContent property of MaskedInput to display some custom content  (or just empty string) when the mask value is null. More information you can find in our help article Watermark. If this is not your scenario, please give us more information about the Value of the MaskedInput and when the control shows "0".
2) Please have in mind that the RadMaskedNumericInput is designed to work with numbers and its Value property is of type nullable double. However, for your scenario if the Latitude property in the ViewModel is of type decimal? we recommend you using RadMaskedCurrencyInput instead and set IsCurrencySymbolVisible property to false.

As for the next 2 requirements: 
- to show 5 decimal digits - you can set FormatString property to "n5": 
<telerik:RadMaskedCurrencyInput IsCurrencySymbolVisible="False"  
        Mask="c2" FormatString="n5"  
Value="{Binding Latitude, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

- you can restrict the minimum and and maximum value (between 32 and 38) of the MaskedInput implementing custom validation rule for the Latitude property. You can find examples for this in our help article Using DataAnnotation Attributes and SDK demo DataValidation.

I hope this information is helpful.

Regards,
Milena
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
 
0
Balakumar
Top achievements
Rank 1
answered on 31 May 2017, 12:30 PM

Hi Team,

The above reported same issue still occurs.

RadMaskedNumericInput control loads with 0. Could you please update me on this

Xaml

 

<telerikInput:RadMaskedTextInput MaskType="Numeric" x:Name="txtQty" TargetUpdated="txtQty_TargetUpdated" HorizontalAlignment="Right" HorizontalContentAlignment="Right"
                                                           Grid.Column="0"  Margin="0,0 0 0"  Loaded="RadMaskedTextBox_Loaded" behavior:MaskedTextBox.SelectAllTextOnFocus="True"
                                                           Width="40" Height="22" VerticalAlignment="Center" EmptyContent=" " telerik:DragDropManager.AllowDrag="True"
                                                           MaxLength="16" MaskedText="{Binding Qty,Mode=TwoWay}" PreviewKeyDown="RadMaskedTextBox_PreviewKeyDown" LostFocus="RadMaskedTextBox_LostFocus"
                                                       GotFocus="txtQty_GotFocus">

 

Regards,

Ganesh

0
Dinko | Tech Support Engineer
Telerik team
answered on 02 Jun 2017, 12:42 PM
Hello Balakumar,

Looking at the provided code snippet we can see that you have set the MaskType property of the RadMaskedTextInput control to Numeric. This option doesn't exist with the latest version of RadMaskedInput for WPF.

It will be great if you can send us isolated project from your application reproducing this behavior so we can directly investigate it on our side. 

Regards,
Dinko
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
crazy05
Top achievements
Rank 1
Answers by
Milena
Telerik team
Balakumar
Top achievements
Rank 1
Dinko | Tech Support Engineer
Telerik team
Share this question
or