Insert Thousand separator as you type (as needed)

5 posts, 1 answers
  1. Sintayehu
    Sintayehu avatar
    67 posts
    Member since:
    Jan 2013

    Posted 10 Jan 2014 Link to this post

    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?
  2. Sintayehu
    Sintayehu avatar
    67 posts
    Member since:
    Jan 2013

    Posted 13 Jan 2014 Link to this post

    I think I can just avoid the custom work by using the No Mask feature with String format ,Min and Max input extensions.
  3. DevCraft banner
  4. Answer
    Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 15 Jan 2014 Link to this post

    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 >>
  5. Sintayehu
    Sintayehu avatar
    67 posts
    Member since:
    Jan 2013

    Posted 29 Jan 2014 in reply to Petar Mladenov Link to this post

    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.                                                                                                                                                                                                                                                                                                                                                                                                                                                                  













  6. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 03 Feb 2014 Link to this post

    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 >>
Back to Top
DevCraft banner