Use attached to reproduce. This is not an issue. Performing Begin/End update disposes of all elements along with the globally declared item. You need to check if the item is disposed of: void ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e) { if (menuItem.IsDisposed) { menuItem = new RadMenuItem(); menuItem.Text = "Custom menu item"; menuItem.Click += menuItem_Click; } e.ContextMenu.Items.Add(menuItem); }
This is not an issue. Performing Begin/End update disposes all elements along with the globally declared item. You need to check if the item is disposed of: void ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e) { if (menuItem.IsDisposed) { menuItem = new RadMenuItem(); menuItem.Text = "Custom menu item"; menuItem.Click += menuItem_Click; } e.ContextMenu.Items.Add(menuItem); }