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

RadMaskedTextBox allow Users to insert data when editing

3 Answers 121 Views
MaskedEditBox
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 22 Nov 2011, 03:42 AM
Hi,

I'm having trouble with the edit functionality of the RadmaskedTextBox.  We have a masked textbox for phone numbers with the following mask: "(##) #### ####" where the area code is in the brackets, followed by the actual number.

The problem is that when this textbox is populated with data from the database, sometimes the phone number does not have the area code, so it appears like this: (12) 1234 12__.  When the textbox is selected and the caret placed at the start of the text, instead of inserting the missing area code at the start, it over-writes the existing data.

I have tried setting the textbox mask to be "##########" and the displayMask to be "(##) #### ####", but it still pads out the missing characters and over-writes the data when edited.

Is there a way of doing this?  Or should we just go back to using standard textboxes?

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 24 Nov 2011, 06:05 PM
Hi Simon,

Thank you writing.

RadMaskedEditBox does not support this functionality. You cannot shift the numbers in the Standard Mask.
Do not hesitate to contact us if you have other questions.

Regards,
Peter
the Telerik team

Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

0
Simon
Top achievements
Rank 1
answered on 25 Nov 2011, 12:12 AM
Thanks for your reply Peter.
Can you advise on whether there is any plans to support this functionality?  Because quite frankly its a very clunky UI if users are forced to over-write all of the data in the textbox if they just want to add a character to the start.
A suggested functionality would be to allow the mask to be disabled onfocus so that the data can be edited easily, then reapplied when they move away from the field.
After all, we are all in this to make it easier for users...
0
Peter
Telerik team
answered on 30 Nov 2011, 08:44 AM
Hi Simon,

I am afraid that mask cannot support character insert, because it defines what stands behind every position - letter ot digit. For example Mask can be "0L0(L)L0" that means digit, letter, digit, letter, letter, digit and we cannot shift correctly the characters to their new positions because the order of characters will be broken. These scenarios can be more complex and this kind of mask does not support shifting.

Do not hesitate to contact us if you have other questions.

Kind regards,
Peter
the Telerik team

Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

Tags
MaskedEditBox
Asked by
Simon
Top achievements
Rank 1
Answers by
Peter
Telerik team
Simon
Top achievements
Rank 1
Share this question
or