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

TdxGanttControlTaskCreateEvent Type

Performs a set of actions during a task create operation (with the mouse) in the chart.

#Declaration

Delphi
TdxGanttControlTaskCreateEvent = procedure(Sender: TObject; AID: Integer; AStart: TDateTime; AFinish: TDateTime; var AAccept: Boolean) of object;

#Parameters

Name Type Description
Sender TObject

The Chart View that raised the event.

AID Integer

The task’s unique identifier.

AStart TDateTime

The task’s start date.

AFinish TDateTime

The task’s finish date.

AAccept Boolean

Specifies if the event handler accepts or declines a task create operation in response to a mouse drag-and-drop action.

#Remarks

You can open the Features Demo and modify its code. Handle the OnTaskCreate event and use the following code snippet to restrict users from creating tasks that last more than seven days:

procedure TFeaturesDemoMainForm.GanttControlViewChartTaskCreate(Sender: TObject;
  AID: Integer; AStart, AFinish: TDateTime; var AAccept: Boolean);
begin
  AAccept := AFinish - AStart < 7;
end;
See Also