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

TdxGanttControlTaskMoveEvent Type

Performs a set of actions in response to a task movement in the chart area.

#Declaration

Delphi
TdxGanttControlTaskMoveEvent = procedure(Sender: TObject; ATask: TdxGanttControlTask; ANewStart: TDateTime; var AAccept: Boolean) of object;

#Parameters

Name Type Description
Sender TObject

The Chart View that raised the event.

ATask TdxGanttControlTask

The task that a user drags.

ANewStart TDateTime

The ATask‘s new start date.

AAccept Boolean

Specifies if the event handler accepts or declines the task drag-and-drop operation in the chart.

#Remarks

You can open the Features Demo and modify its code. Handle the OnTaskMove event and use the following code snippet that prevents users from shifting a task’s start date by more than seven days:

procedure TFeaturesDemoMainForm.GanttControlViewChartTaskMove(Sender: TObject;
  ATask: TdxGanttControlTask; ANewStart: TDateTime; var AAccept: Boolean);
begin
  AAccept := ANewStart - ATask.Start < 7;
end; 
See Also