Skip to main content
A newer version of this page is available. .

DefaultColumnMenuItemNames Class

Contains default item captions displayed within the column context menu.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v17.2.dll

Declaration

public class DefaultColumnMenuItemNames :
    DefaultColumnMenuItemNamesBase

Remarks

For information and an example of how default menu item captions can be changed, see How to: Localize a Grid by Replacing Specific Strings at Runtime.

Example

The following example demonstrates how to customize the grid’s context menu at runtime. For instance this sample demonstrates how to remove the default ‘Show Column Chooser’ menu item from the Column Context Menu, and add a custom item instead.

For this, it is necessary to handle the DataViewBase.ShowGridMenu event. In the event handler, all modifications to the list of menu items can be done by changing the GridMenuEventArgs.Customizations collection. To remove a specific menu item along with its link, use the RemoveBarItemAndLinkAction instance, and to add a custom menu item, a new BarButtonItem object must be added to the e.Customizations collection.

<dxg:GridControl.View>
    <dxg:TableView ShowGridMenu="TableView_ShowGridMenu" />
</dxg:GridControl.View>

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DefaultColumnMenuItemNames 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.

Inheritance

Object
DevExpress.Xpf.Grid.DefaultColumnMenuItemNamesBase
DefaultColumnMenuItemNames
See Also