To reproduce:
radMaskedEditBox1.MaskedEditBoxElement.ContextMenuEnabled = true;
Workaround:
public RadForm1()
{
InitializeComponent();
radMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Standard;
radMaskedEditBox1.Mask = "9999999999";
radMaskedEditBox1.MaskedEditBoxElement.ContextMenuEnabled = true;
radMaskedEditBox1.MaskedEditBoxElement.ContextMenu = BuildContextMenu();
}
private RadContextMenu BuildContextMenu()
{
var contextMenu = new RadContextMenu();
if (contextMenu == null)
{
contextMenu = new RadContextMenu();
}
if (contextMenu.Items.Count == 0)
{
RadMenuItem menuItem = new Telerik.WinControls.UI.RadMenuItem("Cut");
menuItem.Name = "Cut";
contextMenu.Items.Add(menuItem);
menuItem.Click += new System.EventHandler(this.ContextMenuMenuItem_Click);
menuItem = new Telerik.WinControls.UI.RadMenuItem("Test");
menuItem.Name = "Copy";
contextMenu.Items.Add(menuItem);
menuItem.Click += new System.EventHandler(this.ContextMenuMenuItem_Click);
menuItem = new Telerik.WinControls.UI.RadMenuItem("Paste");
menuItem.Name = "Paste";
contextMenu.Items.Add(menuItem);
menuItem.Click += new System.EventHandler(this.ContextMenuMenuItem_Click);
menuItem = new Telerik.WinControls.UI.RadMenuItem("Delete");
menuItem.Name = "Delete";
contextMenu.Items.Add(menuItem);
menuItem.Click += new System.EventHandler(this.ContextMenuMenuItem_Click);
menuItem = new Telerik.WinControls.UI.RadMenuItem("Select All");
menuItem.Name = "Select All";
contextMenu.Items.Add(menuItem);
menuItem.Click += new System.EventHandler(this.ContextMenuMenuItem_Click);
}
return contextMenu;
}
void ContextMenuMenuItem_Click(object sender, EventArgs e)
{
switch (((Telerik.WinControls.UI.RadMenuItem)(sender)).Name.ToUpper())
{
case "UNDO":
//this.radMaskedEditBox1.MaskedEditBoxElement.TextBoxItem.;
break;
case "CUT":
this.radMaskedEditBox1.MaskedEditBoxElement.TextBoxItem.Cut();
break;
case "COPY":
this.radMaskedEditBox1.MaskedEditBoxElement.TextBoxItem.Copy();
break;
case "PASTE":
this.radMaskedEditBox1.MaskedEditBoxElement.TextBoxItem.Paste();
if (!this.radMaskedEditBox1.MaskedEditBoxElement.Provider.Validate(this.Text))
{
this.radMaskedEditBox1.MaskedEditBoxElement.TextBoxItem.TextBoxControl.Undo();
}
break;
case "DELETE":
this.radMaskedEditBox1.MaskedEditBoxElement.TextBoxItem.Clear();
break;
case "SELECT ALL":
this.radMaskedEditBox1.MaskedEditBoxElement.TextBoxItem.SelectAll();
break;
default:
break;
}
}