Skip to main content

BarItemLinkActionBase.ItemLinkIndex Attached Property

Gets or sets the index of the bar item link in the object’s collection of bar item links. This is an attached property.

Namespace: DevExpress.Xpf.Bars

Assembly: DevExpress.Xpf.Core.v23.2.dll

NuGet Package: DevExpress.Wpf.Core



Type Description

The index of the bar item link in the object’s collection of bar item links.


This property is in effect for the BarManagerActionContainer.Actions collection’s BarItem and BarItemLink descendants.


The following example demonstrates how to add a custom menu item to a grid column’s context menu:

Grid - Add Items to the Context Menu

View Example: Customize the GridControl's Context Menu


Add a bar item (for example, BarCheckItem) to the DataViewBase.ColumnMenuCustomizations collection and specify item properties. Attach the BarItemLinkActionBase.ItemLinkIndex property to this item to insert it into a specific position.

    <dxb:BarCheckItem Content="Checked" IsChecked="True" dxb:BarItemLinkActionBase.ItemLinkIndex="0"/>
    <dxb:BarItemLinkSeparator dxb:BarItemLinkActionBase.ItemLinkIndex="1"/>

In Code

Handle the ShowGridMenu event.

<dxg:TableView ShowGridMenu="ShowGridMenu"/>
void ShowGridMenu(object sender, GridMenuEventArgs e) {
    if (e.MenuType == GridMenuType.Column) {
        BarCheckItem item1 = new BarCheckItem { Content = "Checked", IsChecked = true };
        BarItemLinkActionBase.SetItemLinkIndex(item1, 0);
        BarItemLinkSeparator item2 = new BarItemLinkSeparator();
        BarItemLinkActionBase.SetItemLinkIndex(item2, 1);

The following code snippets (auto-collected from DevExpress Examples) contain references to the ItemLinkIndex attachedproperty.


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.

See Also