MaskedImput vs MaskedTextBox

7 posts, 1 answers
  1. Andrew
    Andrew avatar
    171 posts
    Member since:
    Jun 2009

    Posted 27 Jul 2011 Link to this post

    What is the difference between the two controls?
  2. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 01 Aug 2011 Link to this post

    Hello Andrew,

    The new MaskedInput suite of controls provides 4 different controls - MaskedDateTimeInput, MaskedTextInput, MaskedNumericInput and MaskedCurrencyInput. Each control is designed to allow a specific type of user input. We decided to provide this suite of controls due to the many known limitations in the RadMaskedTextBox control. For example, the MaskedInput controls support a null value.

    Also, they further enhance the validation support by providing validation through Regular Expressions, ValidatesOnExceptions and binding validations. Furthermore, the MaskedInput controls allow you to define custom mask tokens. You can read more about the MaskedInput controls in our online documentation.

    However, there are still cases in which the RadMaskedTextBox control might be a better choice. If you can describe the scenario you have, we might be able to tell you which control exactly is most suitable for you.

    All the best,
    Kiril Stanoev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  3. DevCraft banner
  4. Andrew
    Andrew avatar
    171 posts
    Member since:
    Jun 2009

    Posted 01 Aug 2011 Link to this post

    At this moment i was simply looking for a masked control to replace my telerik:DataFormComboBoxField inside the dateform.
    The fields i have are:
    Name - here i just need a watermark
    Description - watermark
    Units - numeric mask
    Price - price mask - showing british pound sign

    So not very complex.

    Thanks
  5. Answer
    Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 04 Aug 2011 Link to this post

    Hi Andrew,

    Thank you for getting back to us. In the described scenario the MaskedInput suite of controls is a better choice. This demo sample can help you get started. More information about the controls you can read in their online documentation.

    All the best,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  6. Sergey
    Sergey avatar
    23 posts
    Member since:
    Oct 2011

    Posted 05 Oct 2012 Link to this post

    I am also looking for commonality and special features on both.
    Here is my case:

    I am building Phone CustomControl. It has two parts related to the topic.
    One is the TextBox that Visible when the (bound) Country is not US and displays free text
    The other is MaskedTextBox/Input that is Visible when the Country is US and allow formatted entry like (###)###-####

    They (TextBox and Masked...) bound to same property (String Phone).

    The issue with MaskedTextInput (does not appear with MaskedTextBox) that
    when I enter The phone "1112223333" into TextBox (not US) and then
    switch country to US the MaskedTextInput overwrites Phone property with an empty Mask (  "( ___)___-____"  ).
    The MaskedTextBox does not do that it takes (bound) unformatted string and displays it as "(111)222-3333"

    Questions are:
    1. Is there a propery on MaskedTextInput that will fix that?
    2. Why should use one or the other? (MaskedTextBox vs MaskedTextInput)
  7. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 10 Oct 2012 Link to this post

    Hello Sergey,

    Let us first make a quick clarification - we are now in a process of resolving the MaskedInput's main issues (that usually stop our clients upgrading from MaskedTextBox to MaskedInput) and our goal is to obsolete the RadMaskedTextBox next year.

    Now straight to your issue. We tried different scenarios (changing the culture) with RadMaskedTextInput, TextBox and RadMaskedTextBox bound to the same property. It seems that the code works as expected. Please take a look of the attached project and see if it works for you. In case it is not suitable please change the project in way corresponding to your scenario.

    All the best,
    Pavel R. Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  8. Sergey
    Sergey avatar
    23 posts
    Member since:
    Oct 2011

    Posted 10 Oct 2012 Link to this post

    Hello Pavel,

    The issue I had was related to the fact (I think) that I bound MaskedTextInput.Text to the phone property. Binding to the MaskedTextInput.Value worked correctly (as in your example). Thank you.
Back to Top
DevCraft banner