I have a RadMaskedEdit box for phone number entry.
...
Telerik.WinControls.UI.RadMaskedEditBox editPhone =
new
Telerik.WinControls.UI.RadMaskedEditBox();
...
editPhone.Mask =
"(000)000-0000"
;
editPhone.MaskType = Telerik.WinControls.UI.MaskType.Standard;
editPhone.Name =
"editPhone"
;
editPhone.Text =
"(___)___-____"
;
editPhone.TextMaskFormat = System.Windows.Forms.MaskFormat.IncludeLiterals;
I have defined a Customer class (simplified for this example)
public
class
Customer {
public
string
CustomerName {
get
;
set
; }
public
string
PhoneNumber {
get
;
set
; }
}
I bind the RadMaskedEditBox Value property to the PhoneNumber property of a Customer object.
Customer editCustomer =
new
Customer();
...
editPhone.DataBindings.Clear();
editPhone.DataBindings.Add(
"Value"
, editCustomer,
"PhoneNumber"
, false, DataSourceUpdateMode.OnPropertyChanged | DataSourceUpdateMode.OnValidation);
After this, when editing the phone number, using the "Del" or "Backspace" key will properly remove the character, but will move the caret to the first position of the text box.
If I remove the Data Binding, the "Del" and "Backspace" keys work as expected. I don't have any event handling code for this control. Currently we are using version 2016.3.913.40.
Is there a workaround, fix, or other change I can implement that will avoid the behavior as I've described?