Skip to main content

TdxGanttControlChartViewPopupMenuItems.DeleteTask Property

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

Declaration

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