Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

GanttControl.TaskPopupMenuShowing Event

Fires when a context menu for a task is about to be shown.

Namespace: DevExpress.XtraGantt

Assembly: DevExpress.XtraGantt.v24.2.dll

NuGet Package: DevExpress.Win.Gantt

#Declaration

[DXCategory("Events")]
public event GanttTaskPopupMenuShowingEventHandler TaskPopupMenuShowing

#Event Data

The TaskPopupMenuShowing event's data class is GanttTaskPopupMenuShowingEventArgs. The following properties provide information specific to this event:

Property Description
Cancel Gets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.
Info Provides access to view information about the task.
Items Provides access to menu items.
Node Gets the node in the tree area for which the menu is about to be shown.

#Example

The code below shows how to populate the context menu with items.

using DevExpress.XtraEditors;
using DevExpress.XtraGantt;

private void ganttControl1_TaskPopupMenuShowing(object sender, GanttTaskPopupMenuShowingEventArgs e) {
    e.Items.Add(new DevExpress.Utils.Menu.DXMenuItem("Show Text", (ss, ee) => { XtraMessageBox.Show(e.Node.GetText()); }));
}
See Also