MaskedTextBox - Hide enumeration character

3 posts, 0 answers
  1. Peter
    Peter avatar
    24 posts
    Member since:
    Oct 2012

    Posted 28 Jan 2013 Link to this post

    Hi, 

    I have following masked textbox =>

    <telerik:RadMaskedTextBox id="txtFlightNumber" runat="server" width="70px" SelectionOnFocus="SelectAll"
        Mask="<C|D|E>L ####<E|F>"  />
    

    Mask works correctly and allow me to insert either C, D or E, but when the control is loaded, it displayes "C_ ____E" . What attribute should I set to hide those enumeration characters ? I want to display empty control. I tried EmptyMessage, DisplayMask and nothing worked. Maybe I used it wrong way... 

    And there is also another thing... When those characters are displayed, during gathering the data I get txtFlightNumber.Text = "CE", but user didn't insert any data there... I want to get empty message...

    Do you have any idea?

    Thanks in advance

    Peter
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 29 Jan 2013 Link to this post

    Hi Peter,

    I suppose you want to hide the enumeration characters on pageLoad and on its focus it should show the characters...
    Try seting DisplayMask with a space in it and it should work.
    <telerik:RadMaskedTextBox ID="txtFlightNumber" runat="server" Width="70px" SelectionOnFocus="SelectAll"
     DisplayMask="  " Mask="<C|D|E>L ####<E|F>" />

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Peter
    Peter avatar
    24 posts
    Member since:
    Oct 2012

    Posted 29 Jan 2013 Link to this post

    Thanks for the advice, but even when I type some input there and leaving the control nothing stayed displayed.

    It worked when I set  AllowEmptyEnumerations="true"
Back to Top