Bug: Masking without thousand or decimal placeholder not working in MVVM

4 posts, 0 answers
  1. Steve
    Steve avatar
    17 posts
    Member since:
    Oct 2014

    Posted 18 May Link to this post

    Hi,

    we can't use the MaskedTextBox in our MVVM project because there's a bug when masking with only digits & spaces (for example the simple mask "999"). The mask won't work because a function from Kendo UI seems to expect a thousand or decimal placeholder. This can be easily reconstructed in the MVVM demo for the MaskedTextBox:

    http://dojo.telerik.com/exIYe

    I just changed the mask to "999" and it is not working any longer. As far as I can tell, no combination without a decimal or thousand placesholder seems to work. Except "000" for example also seems fine, but the number shown is not masked the right way.

    Could you please look into this?

    Regards,

    Steve.

  2. Stefan
    Admin
    Stefan avatar
    264 posts

    Posted 18 May Link to this post

    Hello Steve,

    This scenario for the Kendo UI MaskedTextBox is explained in MVVM Important Notes:

    http://docs.telerik.com/kendo-ui/framework/mvvm/overview#important-notes

    You can also check the example for a custom MVVM binding:

    http://docs.telerik.com/kendo-ui/controls/editors/maskedtextbox/how-to/MVVM/custom-mask-binding#customize-masks-through-mvvm-binding

    Let me know if you need additional assistance.

    Regards,
    Stefan
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Steve
    Steve avatar
    17 posts
    Member since:
    Oct 2014

    Posted 19 May in reply to Stefan Link to this post

    Ok, thanks for your reply. Seems like quite the hassle to go through just for masking it to say "I just want numbers from 0 to 999". It works like this if you initialize the widget in JavaScript, doesn't it?

    Anyways, I think I'll just use a SpinEditor with the spinners turned off. Seems like the easier way to me in my case.

    Regards,

    Steve.

  5. Stefan
    Admin
    Stefan avatar
    264 posts

    Posted 19 May Link to this post

    Hello Steve,

    You are welcome.

    Yes, the widget will work with a numeric mask if you initialize it via JavaScript.

    Also if you are using variable-length numbers without special formatting or masking, the Kendo UI NumericTextBox is a better solution:

    http://docs.telerik.com/kendo-ui/controls/editors/numerictextbox/overview

    Regards,
    Stefan
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready