Skip to content

DevExpress-Examples/winforms-treelist-customize-node-menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WinForms TreeList - Customize node context menu

This example demonstrates how to handle the PopupMenuShowing event to add new commands to the node menu:

private void treeList1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e) {
    if(e.Menu is TreeListNodeMenu) {
        treeList1.FocusedNode = ((TreeListNodeMenu)e.Menu).Node;
        e.Menu.Items.Add(new DevExpress.Utils.Menu.DXMenuItem("Edit", bbEdit_ItemClick));
        e.Menu.Items.Add(new DevExpress.Utils.Menu.DXMenuItem("Add child", bbAddChild_ItemClick));
        e.Menu.Items.Add(new DevExpress.Utils.Menu.DXMenuItem("Delete", bbDelete_ItemClick));
    }
}

Files to Review

Documentation