MaskedTextBox using Enumeration parts delete not working as expected

3 posts, 0 answers
  1. Chris
    Chris avatar
    4 posts
    Member since:
    Nov 2008

    Posted 19 May 2016 Link to this post


    Hi,

    I am using the Maskedtextbox for user input of a mac address, I am using the following code which works fine.  It displays "00-00-00-00-00-00" on initial load and only accepts characters 0-9 and A-F

    <telerik:RadMaskedTextBox RenderMode="Lightweight" ID="RadMaskedTextBox3" runat="server" <br>Mask="<0|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F><0|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F>-<0|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F><br><0|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F>-<0|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F><0|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F>-<br><0|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F><0|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F>-<0|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F><br><0|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F>-<0|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F><0|1|2|3|4|5|6|7|8|9|A|B|C|D|E|F>"><br></telerik:RadMaskedTextBox>



    The issue arises when I press the backspace to delete, all that happens is the cursor moves back but does not reset the character back to the initial mask value which is what I would expect to happen.

    How can I achieve this.

    Chris
  2. Vasil
    Admin
    Vasil avatar
    1603 posts

    Posted 19 May 2016 Link to this post

    Hi Chris,

    Try out to set these properties to make it work as you are expecting:

    AllowEmptyEnumerations="true"
    PromptChar="0"


    Regards,
    Vasil
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. Chris
    Chris avatar
    4 posts
    Member since:
    Nov 2008

    Posted 19 May 2016 in reply to Vasil Link to this post

    Thanks Vasil for your quick reply,

    your suggestion works perfectly.

     

    Chris

Back to Top