TdxGanttControlTaskMoveEvent Type
In This Article
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 | Tdx |
The task that a user drags. |
ANew |
TDate |
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