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

some questions about RadMaskedNumericInput

1 Answer 117 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Zhang
Top achievements
Rank 1
Zhang asked on 07 Dec 2015, 04:54 AM

my requirement as below:

1:  Don't display the underline and thousand-separator when the text box is focused

2: If the number typed is bigger than one thousand, it will fill  thousand-separator automatically (the text box is still being focused).For example, if I type in 123,then it displays as 123.00;then I input the fourth  number 7,I want it displays as 1,237.00 immediately(not only after the text box lost focused). it's important that keeping  then cursor position be after the number 7.

3:when the entire content is selected and I delete it,the value of the the text box should be zero and displays as 0.00

 many thanks


1 Answer, 1 is accepted

Sort by
0
Peshito
Telerik team
answered on 08 Dec 2015, 09:56 AM
Hi Zhang

Not displaying the thousand separator and the underline when the control is not being focused is possible with the following combination of properties: Placeholder=" " and AutoFillNumberGroupSeparators="False".

In order to customize the way your masked control behaves when entering input, use the Mask property, for instance like this Mask="#4.2".

As for the question about showing 0.00 when the input is selected and then deleted, this can be achieved with the help of MaskedInputExtensions. Include the extensions' namespace first xmlns:maskedInput="clr-namespace:Telerik.Windows.Controls.MaskedInput;assembly=Telerik.Windows.Controls.Input" and then set the AllowNull property to False.

Below is a sample showing the above approach:
<telerik:RadMaskedNumericInput
                    TextMode="PlainText"
                    Mask="#4.2"
                    Placeholder=" "
                    AutoFillNumberGroupSeparators="False"
                    maskedInput:MaskedInputExtensions.AllowNull="False"/>

Hope this helps.

Regards,
Peshito
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
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Zhang
Top achievements
Rank 1
Answers by
Peshito
Telerik team
Share this question
or