Thank you for your interest in our RadMaskedInput controls.
Upon reading your requirements, there is not a build-in set-up to achieve this. The struggle comes from the fact that the user can enter a different number of digits after the dot. So you will need to remove the Mask property and work with No Mask scenario. This way, you can't enter decimal dot separator as the control is not aware of how many numbers after the dot will be entered.
<telerik:RadMaskedNumericInput Placeholder=" " Mask="" Height="30" Width="200" />
What you can consider is using our RadMaskedTextInput control. The struggle here will be that you will need to handle the input which comes from the user. For example, you can subscribe to the PreviewKeyDown event of the control and check if the user enters numbers. If not, handle the event. For example:
<telerik:RadMaskedTextInput Mask="" Height="30" Width="200" VerticalAlignment="Center"
PreviewKeyDown="RadMaskedTextInput_PreviewKeyDown" Placeholder=" "/>
private void RadMaskedTextInput_PreviewKeyDown(object sender, KeyEventArgs e)
if( ! (e.Key == Key.D0 ||
e.Key == Key.D1 ||
e.Key == Key.D2 ||
e.Key == Key.D3 ||
e.Key == Key.D4 ||
e.Key == Key.D5 ||
e.Key == Key.D6 ||
e.Key == Key.D7 ||
e.Key == Key.D8 ||
e.Key == Key.D9 ||
e.Key == Key.OemPeriod
e.Handled = true;
The above code snippet will cover only one scenario. You will need to extend it so it covers all keyboard numbers (NumPad numbers). Also, handle the case when the user press dot again, etc.
Can you give the above suggestion a try and let me know if I have missed something from your scenario?
Progress is here for your business, like always. Read more
about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.