Skip to main content

TdxGanttControlTaskEndDragEvent Type

Performs a set of actions in response to the task movement in the Chart View‘s task sheet.

Declaration

TdxGanttControlTaskEndDragEvent = procedure(Sender: TObject; ATask: TdxGanttControlTask) of object;

Parameters

Name Type Description
Sender TObject

The Chart View that raised the event.

ATask TdxGanttControlTask

A rearranged task.

Remarks

You can open the Features Demo and modify its code. The code snippet below shows how you can handle the OnTaskEndDrag event to add the Flag1 custom field that specifies that a task was rearranged:

procedure TFeaturesDemoMainForm.GanttControlViewChartOptionsSheetTaskEndDrag(
  Sender: TObject; ATask: TdxGanttControlTask);
var
  AValue: TdxGanttControlExtendedAttributeValue;
begin
  inherited;
  AValue := ATask.ExtendedAttributes['Flag1'];
  if AValue = nil then
  begin
    AValue := ATask.ExtendedAttributes.Append;
    AValue.FieldID := GanttControl.DataModel.ExtendedAttributes.Find('Flag1', TdxGanttControlExtendedAttributeLevel.Task).FieldID;
  end;
  AValue.Value := True;
end;
See Also