Unexpected behavior removing underscore when using plain text mode

2 posts, 0 answers
  1. Ross
    Ross avatar
    9 posts
    Member since:
    Jul 2011

    Posted 03 Sep 2014 Link to this post

    Just thought I would add a note because I have not been able to see this behaviour documented elsewhere.

    When using

    <telerik:RadMaskedTextInput Mask="" TextMode="PlainText"/>

    adding the text a_b changes to ab when navigated away from. The fix is to use MaskedText as the textmode instead which is the default so it would be
    <telerik:RadMaskedTextInput Mask="" TextMode="MaskedText"/>
    or simply
    <telerik:RadMaskedTextInput Mask=""/>

    Hope this helps anyone else with the same issue

  2. Martin Ivanov
    Martin Ivanov avatar
    2608 posts

    Posted 05 Sep 2014 Link to this post

    Hi Ross,

    This behavior is expected. When you lost the focus from RadMaskedTextInput you see the value of its Text property. The way the Text property is set from the combination of the Value and the Mask properties is controlled by the TextMode property.

    When the TextMode is set to Masked input the control's Text value represents the formatted Value including the placeholder characters. If the property is set to PlainText the Text contains the formatted Value but without the placeholder characters. The default placeholder of the masked input control is an underscore character (_).

    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
Back to Top