Back to Devexpress

TdxGanttControlTaskStartMoveEvent Type

vcl-dxganttcontrolviewchart-e3ed5acc.md

latest2.0 KB
Original Source

TdxGanttControlTaskStartMoveEvent Type

Allows you to prevent a task drag-and-drop operation within the chart.

Declaration

delphi
TdxGanttControlTaskStartMoveEvent = procedure(Sender: TObject; ATask: TdxGanttControlTask; var AAllow: Boolean) of object;

Parameters

NameTypeDescription
SenderTObject

The Chart View that raised the event.

| | ATask | TdxGanttControlTask |

The task that is about to be moved.

| | AAllow | Boolean |

If True , a user can drag and drop tasks in the chart. If False , the operation is prohibited.

|

Remarks

You can open the Features Demo and modify its code. Handle the OnTaskStartMove event and use the following code snippet to forbid the move operation for summary tasks and milestones:

delphi
procedure TFeaturesDemoMainForm.GanttControlViewChartTaskStartMove(Sender: TObject;
  ATask: TdxGanttControlTask; var AAllow: Boolean);
begin
  AAllow := not (ATask.Summary or ATask.Milestone);
end;
cpp
void __fastcall TFeaturesDemoMainForm::GanttControlViewChartTaskStartMove(TObject *Sender,
          TdxGanttControlTask *ATask, bool &AAllow)
{
  AAllow = !(ATask->Summary || ATask->Milestone);
}

See Also

TdxGanttControlTaskMoveEvent

TdxGanttControlTaskEndMoveEvent

dxGanttControlViewChart Unit