To reproduce:
Subscribe for the ContextMenuShowing event of RadScheduler and use the following code:
private void radScheduler1_ContextMenuShowing(object sender, SchedulerContextMenuShowingEventArgs e)
{
e.ContextMenu.Items.Clear();
e.ContextMenu.Items.Add(new RadMenuItem("Item"));
}
Right-Click on two appointments and you will notice the exception
Workaround:
Add three invisible items:
private void radScheduler1_ContextMenuShowing(object sender, SchedulerContextMenuShowingEventArgs e)
{
e.ContextMenu.Items.Clear();
e.ContextMenu.Items.Add(new RadMenuItem("Item"));
for (int i = 0; i < 3; i++)
{
e.ContextMenu.Items.Add(new RadMenuItem() { Visibility = ElementVisibility.Collapsed });
}
}