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

Cannot show leading zeros with RadMaskedNumericInput

3 Answers 198 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Lu
Top achievements
Rank 1
Lu asked on 11 Mar 2020, 05:38 PM

I'm trying to only allow users to type in 6 digits integer with prefix "CA", and now I can only type in one leading zero, not multiple zeros. 

Here is my code, and ProjectNumber is a nullable double. 

<telerik:RadMaskedNumericInput                     

Grid.Column="0"                   

Margin="25, 0, 0, 10"                    

Width="100"                   

Mask="CA#####"                   

Placeholder=""                            

AutoFillZeros="False"                   

AutoFillNumberGroupSeparators ="False"                   

IsClearButtonVisible="False"                                       

AllowInvalidValues="True"                   

Validation.ErrorTemplate="{x:Null}"                   

maskedInput:MaskedInputExtensions.Minimum="0"                     

HorizontalContentAlignment="Left"                   

HorizontalAlignment="Left"                                        

Value="{Binding Path=(viewModel:IProjectFolderViewModel.ProjectNumber), Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

 

Also, the prefix 'CA' only appears after users click on the input box or type in something. is there anyway that we could show the prefix all the time. 

3 Answers, 1 is accepted

Sort by
0
Lu
Top achievements
Rank 1
answered on 13 Mar 2020, 04:24 AM
Anyone can help??
0
Martin Ivanov
Telerik team
answered on 16 Mar 2020, 04:20 PM

Hello Lu,

I will check this and share my findings later today or tomorrow.

Regards,
Martin Ivanov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Martin Ivanov
Telerik team
answered on 19 Mar 2020, 08:08 AM

Hello Lu,

RadMaskedNumericInput doesn't support leading zeroes. Instead you can use  RadMaskedTextInput with only numeric values allowed.

About the disappearing CA prefix I wasn't able to reproduce this on my side using the latest version of Telerik UI for WPF.

Regards,
Martin Ivanov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Lu
Top achievements
Rank 1
Answers by
Lu
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or