RadMaskedNumericInput only returning 1 decimal place when 2 are input

2 posts, 0 answers
  1. Patrick
    Patrick avatar
    5 posts
    Member since:
    Oct 2012

    Posted 23 Sep 2015 Link to this post

    I have an issue with RadMaskedNumericInput where the value returned only has 1 decimal even the 2 decimals were input.

    The xaml looks like this:

    <telerik:RadMaskedNumericInput
        Name="AddHours"
        Width="75" 
        Mask="#,###.##"
        SelectionOnFocus="SelectAll"
        Value="{Binding AddHours}" 
        UpdateValueEvent="LostFocus"
        Culture="en-CA"
        Grid.Column="3" Grid.Row="1"
        HorizontalContentAlignment="Right"
        HorizontalAlignment="Left"
        VerticalAlignment="Top"
        Margin="3" Padding="2" 
        Style="{StaticResource HoursStyle}"        PreviewKeyDown="RadMaskedNumericInput_PreviewKeyDown"
     />

    Bound Property

    public decimal AddHours
    {
        get { return addHours; }
        set
        {
            if (addHours != value)
            {
                addHours = value;
                OnPropertyChanged("AddHours");
     
            }
        }
    }

    I've tried specifying the mask differently but same behaviour with other configurations.  ???
  2. Patrick
    Patrick avatar
    5 posts
    Member since:
    Oct 2012

    Posted 23 Sep 2015 in reply to Patrick Link to this post

    Sorry, I figured this out it was the preview key routine causing the issue.
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top