RemoveBarItemAndLinkAction Class
Removes a bar item from the BarManager.Items collection, and removes all links to this bar item from link holders (bars, submenus, menus, etc.).
Namespace: DevExpress.Xpf.Bars
Assembly: DevExpress.Xpf.Core.v18.2.dll
Declaration
Remarks
A bar item to be removed can be specified via the inherited BarItemActionBase.ItemName or BarItemActionBase.ItemIndex property. The BarItemActionBase.ItemIndex property is in effect if the BarItemActionBase.ItemName property is not set.
<dxb:BarManagerActionContainer>
<dxb:RemoveBarItemAndLinkAction ItemName="btnAbout"/>
<!--...-->
See Bar Actions to learn more.
Example
The following example demonstrates how to remove a specific item from the context menu, which is shown for the Total Summary panel. For this, the RemoveBarItemAndLinkAction
object is added to the DataViewBase.TotalSummaryMenuCustomizations collection, and the name of the bar item is specified by the corresponding field of the DefaultSummaryMenuItemNames class.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-customize-a-grids-context-menu-e1925.
<dxg:TableView.TotalSummaryMenuCustomizations>
<dxb:RemoveBarItemAndLinkAction ItemName="{x:Static dxg:DefaultSummaryMenuItemNames.Customize}" />
</dxg:TableView.TotalSummaryMenuCustomizations>
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the RemoveBarItemAndLinkAction class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.