RadMaskedNumericInput Problem

4 posts, 0 answers
  1. crazy05
    crazy05 avatar
    74 posts
    Member since:
    Sep 2014

    Posted 11 Jun 2015 Link to this post

    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>

  2. Milena
    Milena avatar
    226 posts

    Posted 15 Jun 2015 Link to this post

    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.

    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
  3. Balakumar
    Balakumar  avatar
    6 posts
    Member since:
    Feb 2011

    Posted 31 May 2017 in reply to Milena Link to this post

    Hi Team,

    The above reported same issue still occurs.

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



    <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"




  4. Dinko
    Dinko avatar
    523 posts

    Posted 02 Jun 2017 Link to this post

    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. 

    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 allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top