Back to Devexpress

TdxGanttControlTaskStartLinkEvent Type

vcl-dxganttcontrolviewchart-d561bdcb.md

latest2.1 KB
Original Source

TdxGanttControlTaskStartLinkEvent Type

Performs a set of actions before a user drags and drops a dependency from one task to another with the mouse.

Declaration

delphi
TdxGanttControlTaskStartLinkEvent = procedure(Sender: TObject; ATask: TdxGanttControlTask; var AAllow: Boolean) of object;

Parameters

NameTypeDescription
SenderTObject

The Chart View that raised the event.

| | ATask | TdxGanttControlTask |

The predecessor task.

| | AAllow | Boolean |

If True , a user can move the mouse pointer from the selected task to another task (while holding the left mouse button) to link them. If False , the operation is prohibited.

|

Remarks

You can open the Features Demo and modify its code. Handle the OnTaskStartLink event and use the following code snippet to prevent a user from linking a summary task to any task:

delphi
procedure TFeaturesDemoMainForm.GanttControlViewChartTaskStartLink(Sender: TObject;
  ATask: TdxGanttControlTask; var AAllow: Boolean);
begin
    AAllow := not ATask.Summary;
end;
cpp
void __fastcall TFeaturesDemoMainForm::GanttControlViewChartTaskStartLink(TObject *Sender,
          TdxGanttControlTask *ATask, bool &AAllow)
{
  AAllow = !(ATask->Summary);
}

See Also

TdxGanttControlTaskLinkEvent

TdxGanttControlTaskEndLinkEvent

dxGanttControlViewChart Unit