This is a migrated thread and some comments may be shown as answers.

MaskedTextBox using Enumeration parts delete not working as expected

1 Answer 47 Views
MaskedTextBox
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 19 May 2016, 10:27 AM

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" 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><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>-<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><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>"></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

1.<telerik:RadMaskedTextBox RenderMode="Lightweight" ID="RadMaskedTextBox3" runat="server" 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><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>-<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><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>"></telerik:RadMaskedTextBox>

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 24 May 2016, 11:07 AM
Hello Chris,

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

AllowEmptyEnumerations="true"
PromptChar="0"


Regards,
Maria Ilieva
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
MaskedTextBox
Asked by
Chris
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or