All docs
V20.2
21.1 (EAP/Beta)
20.2
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

TreeViewControl.NodeMenuCustomizations Property

Allows you to customize the node's context menu. You can add new menu items or remove existing items.

Namespace: DevExpress.Xpf.Grid

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

Declaration

[Browsable(false)]
public BarManagerActionCollection NodeMenuCustomizations { get; }

Property Value

Type Description
BarManagerActionCollection

A collection of bar actions that allows you to customize the node's context menu.

Remarks

The following code sample creates a context menu that allows users to remove nodes and copy a node's data:

<Window
        xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" 
        xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
        ... >
  <dxg:TreeViewControl x:Name="treeview" 
                       ... >
      <dxg:TreeViewControl.NodeMenuCustomizations>
          <dxb:BarButtonItem Name="deleteNode" Content="Delete Node" ItemClick="deleteNode_ItemClick"/>
          <dxb:BarButtonItem Name="copyNodeData" Content="Copy Node Data" ItemClick="copyNodeData_ItemClick"/>
      </dxg:TreeViewControl.NodeMenuCustomizations>
  </dxg:TreeViewControl>
</Window>
void deleteNode_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e) {
    treeview.DeleteNode(treeview.CurrentNode);
}

void copyNodeData_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e) {
    treeview.CopySelectedItemsToClipboard();
}
See Also