Back to Devexpress

TdxGanttControlTaskStartCreateEvent Type

vcl-dxganttcontrolviewchart-2a2dc8c6.md

latest2.3 KB
Original Source

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

NameTypeDescription
SenderTObject

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:

delphi
procedure TFeaturesDemoMainForm.GanttControlViewChartTaskStartCreate(Sender: TObject;
  AID: Integer; AStart: TDateTime; var AAllow: Boolean);
begin
  AAllow := AStart > GanttControl.DataModel.RealProjectStart;
end;
cpp
void __fastcall TFeaturesDemoMainForm::GanttControlViewChartTaskStartCreate(TObject *Sender,
          int AID, TDateTime AStart, bool &AAllow)
{
  AAllow = AStart > GanttControl->DataModel->RealProjectStart;
}

See Also

TdxGanttControlTaskCreateEvent

TdxGanttControlTaskEndCreateEvent

dxGanttControlViewChart Unit