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

Insert Thousand separator as you type (as needed)

4 Answers 430 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Sintayehu
Top achievements
Rank 1
Sintayehu asked on 10 Jan 2014, 05:36 PM
I am on the 2013. 3.1204.1050 version.

Is there a way to make the thousand separator appear only when needed?

Example :
a numeric control with masking of #9.2, with thousand separator enabled, and a place holder of _

___,456,789.22
___,___,_89.22

Some users indicated this is obtrusive and less than attractive.

So we want to see if we can get rid of the place holder and have a thousand separator that gets inserted only as needed.

Currently if I replace the place holder with space I get ...

 ,456,789.22
 ,  , 89.22

Which is even more strange.

So the ideal condition is to insert the comma as user types and as needed:
 456,789.22
 89.22

Can you point me in the right direction on how to achieve this?

4 Answers, 1 is accepted

Sort by
0
Sintayehu
Top achievements
Rank 1
answered on 13 Jan 2014, 09:41 PM
I think I can just avoid the custom work by using the No Mask feature with String format ,Min and Max input extensions.
0
Accepted
Petar Mladenov
Telerik team
answered on 15 Jan 2014, 07:12 AM
Hello Sintayehu,

Yes FormatString and no-mask (Mask = "") is usually our suggestion for such requirements. Let us know if you need further assistance or if you find some issues with these settings.

Regards,
Petar Mladenov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Sintayehu
Top achievements
Rank 1
answered on 29 Jan 2014, 03:30 PM
Hello Petar,

I am using No mask with a Format string of "N2", the issue I am seeing is with the delete key.

When deleting a negative number like      -123,456,789.12.

- if Caret is after the - sign delete does the expected behavior up to the thousand separator, then as soon as it reaches the separator it deletes the entire field.
- if caret is before decimal point  the caret goes back to index 0 (before the - sign.)      

I have tried overriding the handledeletekeynomask function but it relies on internal object for its logic so I didn't pursue any further in that direction.

Once you guys provide possible solution to the above issues I would like to make the Delete key be able to delete the negative sign if the caret is before it. But this wouldn't work without resolving the first two issues.


I am on version 2013. 3.1204.1050.

Thanks for the help.                                                                                                                                                                                                                                                                                                                                                                                                                                                                  













0
Petar Mladenov
Telerik team
answered on 03 Feb 2014, 08:17 AM
Hi Sintayehu,

The Delete Key issue you mentioned will be resolved for the upcoming Q1 release in mid-February.
As for the minus sign deletion - this seems very custom requirement. That is why we highly encourage you to override the OnKeyDown method in class that inherits from NumericInput / CurrencyInput. This way you will be able to achieve *preview event* in Silverlight and perform custom logic for the delete key. 

Regards,
Petar Mladenov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Sintayehu
Top achievements
Rank 1
Answers by
Sintayehu
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or