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

TdxGanttControlTaskStartCreateEvent Type

Performs a set of actions before a user drags and drops the mouse to create a task.

#Declaration

Delphi
TdxGanttControlTaskStartCreateEvent = procedure(Sender: TObject; AID: Integer; AStart: TDateTime; var AAllow: 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.

AAllow Boolean

If True, a user can drag the mouse pointer in the chart (while holding the left mouse button) to create a task. If False, the operation is prohibited.

#Remarks

You can open the Features Demo and modify its code. Handle the OnTaskStartCreate event and use the following code snippet to restrict users from creating tasks that occur before the project’s start date:

procedure TFeaturesDemoMainForm.GanttControlViewChartTaskStartCreate(Sender: TObject;
  AID: Integer; AStart: TDateTime; var AAllow: Boolean);
begin
  AAllow := AStart > GanttControl.DataModel.RealProjectStart;
end;
See Also