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

MaskedTextBox using Enumeration parts delete not working as expected

2 Answers 32 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:33 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" <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 Answers, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 19 May 2016, 10:57 AM
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.
0
Chris
Top achievements
Rank 1
answered on 19 May 2016, 11:10 AM

Thanks Vasil for your quick reply,

your suggestion works perfectly.

 

Chris

Tags
MaskedTextBox
Asked by
Chris
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Chris
Top achievements
Rank 1
Share this question
or