Back to Devexpress

TdxGanttControlTaskStartDragEvent Type

vcl-dxganttcontrolviewchart-45fb0fd3.md

latest1.7 KB
Original Source

TdxGanttControlTaskStartDragEvent Type

Performs a set of actions before a user moves a task in the sheet.

Declaration

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

Parameters

NameTypeDescription
SenderTObject

The Chart View that raised the event.

| | ATask | TdxGanttControlTask |

The task that is about to be rearranged.

| | AAllow | Boolean |

If True , a user can rearrange a task row in the sheet with the mouse. If False , the operation is prohibited.

|

Remarks

You can open the Features Demo and modify its code. The code snippet below shows how you can handle the OnTaskStartDrag event to prevent a user from task rearrangement:

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

See Also

dxGanttControlViewChart Unit