How to: Remove an Item from the Context Menu (legacy)
Note
You are viewing documentation for the legacy WPF Scheduler control. If you’re starting a new project, we strongly recommend that you use a new control declared in the DevExpress.Xpf.Scheduling namespace. If you decide to upgrade an existing project in order to switch to the updated scheduler control, see the Migration Guidelines document.
This example demonstrates how to remove a specific item from the Default Popup Menu of the SchedulerControl using the SchedulerControl.DefaultMenuCustomizations property. Add the RemoveBarItemAndLinkAction class instance to the customizations collection, and specify the name of the bar item to delete.
<!--Add items to the Default popup menu-->
<dxsch:SchedulerControl.DefaultMenuCustomizations>
<dxb:RemoveBarItemAndLinkAction ItemName="{x:Static local:SchedulerMenuItemName.NewAppointment}" />
<dxb:RemoveBarItemAndLinkAction ItemName="{x:Static local:SchedulerMenuItemName.NewRecurringAppointment}" />
<dxb:BarItemSeparator dxb:BarItemLinkActionBase.ItemLinkIndex="1" />
<dxb:BarButtonItem Name="customNavBackItem"
Content="Navigate View Backward"
dxb:BarItemLinkActionBase.ItemLinkIndex="2"
CommandParameter="{Binding ElementName=schedulerControl1}"
Command="{Binding NavigateViewBackward, Mode=OneTime, Source={StaticResource commands}}"/>
<dxb:BarItemSeparator dxb:BarItemLinkActionBase.ItemLinkIndex="3" />
</dxsch:SchedulerControl.DefaultMenuCustomizations>
See Also