Back to Devexpress

GanttControl.TaskPopupMenuShowing Event

windowsforms-devexpress-dot-xtragantt-dot-ganttcontrol-101d20b0.md

latest2.9 KB
Original Source

GanttControl.TaskPopupMenuShowing Event

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

Namespace : DevExpress.XtraGantt

Assembly : DevExpress.XtraGantt.v25.2.dll

NuGet Package : DevExpress.Win.Gantt

Declaration

csharp
[DXCategory("Events")]
public event GanttTaskPopupMenuShowingEventHandler TaskPopupMenuShowing
vb
<DXCategory("Events")>
Public Event TaskPopupMenuShowing As GanttTaskPopupMenuShowingEventHandler

Event Data

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

PropertyDescription
CancelGets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.
InfoProvides access to view information about the task.
ItemsProvides access to menu items.
NodeGets 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.

csharp
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()); }));
}
vb
Imports DevExpress.XtraEditors
Imports DevExpress.XtraGantt

Private Sub ganttControl1_TaskPopupMenuShowing(ByVal sender As Object, ByVal e As GanttTaskPopupMenuShowingEventArgs) _
    Handles ganttControl1.TaskPopupMenuShowing
    e.Items.Add(New DevExpress.Utils.Menu.DXMenuItem("Show Text", Sub(ss, ee)
                                                                      XtraMessageBox.Show(e.Node.GetText())
                                                                  End Sub))
End Sub

See Also

GanttControl Class

GanttControl Members

DevExpress.XtraGantt Namespace