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

TdxGanttControlChartViewPopupMenuItems.DeleteTask Property

Specifies if a task‘s pop-up menu (in the Chart View) displays the Delete Task item.

#Declaration

Delphi
property DeleteTask: TdxGanttControlViewPopupMenuItem read; write; default TdxGanttControlViewPopupMenuItem.Default;

#Property Value

Type Default Description
TdxGanttControlViewPopupMenuItem Default

The active pop-up menu item visibility option.

#Remarks

A user can click the Delete Task menu item to delete the task from the task collection.

#Property Values

Use the DeleteTask property to switch between the following display modes for the item:

Display Mode

Description

Default

The item availability depends on the context.

Disabled

The item is disabled.

Hidden

The item is invisible.

#Code Examples: Delete All Tasks

The Gantt control always contains a root task, and an attempt to delete it causes an exception. The following code example iterates through all tasks and deletes all tasks except for the root:

while dxGanttControl1.DataModel.Tasks.Count > 1 do
  dxGanttControl1.DataModel.Tasks.Delete(1);

Alternatively, you can call the data model’s Tasks.Reset procedure:

  dxGanttControl1.DataModel.Tasks.Reset;

#Default Value

The DeleteTask property’s default value is TdxGanttControlViewPopupMenuItem.Default

See Also