Skip to main content

TdxGanttControlChartViewGetLinkColorEvent Type

The color-related procedural type for task dependencies in the Chart View.

Declaration

TdxGanttControlChartViewGetLinkColorEvent = procedure(Sender: TdxGanttControlChartView; ALink: TdxGanttControlTaskPredecessorLink; var AColor: TColor) of object;

Parameters

Name Type Description
Sender TdxGanttControlChartView

The Chart View that raised the event.

ALink TdxGanttControlTaskPredecessorLink

The dependency whose color is about to be changed.

AColor TColor

A system palette color.

Remarks

A dependency is filled with the same color as its predecessor task. The following code example makes the dependency between the first and second tasks yellow (clYellow):

procedure TMyForm.FormCreate(Sender: TObject);
begin
  // Loads a chart from the specified XML file
  dxGanttControl1.LoadFromFile('C:\Users\Public\Documents\DevExpress VCL Demos\MegaDemos\Product Demos\ExpressGanttControl\Data\SoftwareDevelopment.xml');
end;

procedure TMyForm.dxGanttControl1ViewChartGetLinkColor(
begin
  // Checks if the dependency links the first and second tasks
  if (ALink.PredecessorUID = 2) and (ALink.Task.UID = 3) then
    // Fills the dependency with the yellow color
    AColor := clYellow;
end;
See Also