RadMaskedNumericInput Problem

2 posts, 0 answers
  1. crazy05
    crazy05 avatar
    72 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
    Admin
    Milena avatar
    203 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.

    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
     
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top