Skip to main content

TdxGanttControlTimelineViewGetTaskColorEvent Type

The color-related procedural type for tasks in the Timeline View.

Declaration

TdxGanttControlTimelineViewGetTaskColorEvent = procedure(Sender: TdxGanttControlTimelineView; ATask: TdxGanttControlTask; var AColor: TColor) of object;

Parameters

Name Type Description
Sender TdxGanttControlTimelineView

The Timeline View that raised the event.

ATask TdxGanttControlTask

The task whose color is about to be changed.

AColor TColor

A system palette color.

Remarks

The following code example fills all outdated tasks with red (clRed):

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.dxGanttControl1ViewTimelineGetTaskColor(
  Sender: TdxGanttControlChartView; ATask: TdxGanttControlTask;
  var AColor: TColor);
begin
  // Checks if the inspected task exists and compares its date with the current date
  if (ATask <> nil) and (ATask.Finish < Now) then
    // Fills outdated tasks with the red color
    AColor := clRed;
end;
See Also