Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxGanttControlTimelineViewGetTaskColorEvent Type

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

#Declaration

Delphi
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