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

TdxGanttControlExtendedAttributeValue.Value Property

Specifies a custom field’s value.

#Declaration

Delphi
property Value: Variant read; write;

#Property Value

Type Description
Variant

A custom field value.

#Remarks

Use this property to assign a value to a custom field. The table below shows custom fields and data types they support:

Field Type

Supported Data Type

Cost

Currency

Date

TDateTime

Finish

Start

Duration

ISO 8601. Refer to a task‘s Duration topic for more information.

Flag

Boolean

Number

Double

Text

String

The code example below shows how to retrieve a task‘s custom field values:

var
  ASheetOptions: TdxGanttControlChartViewSheetOptions;
  ATask: TdxGanttControlTask;
  I: Integer;
begin
  // Loads a Gantt chart from the ExtendedAttributes XML file
  dxGanttControl1.DataModel.LoadFromFile('C:\Users\Public\Documents\DevExpress\VCL\Demos\ExpressGantt Control\Data\ExtendedAttributesDemo.xml');
  // Initializes the ASheetOptions variable to a TdxGanttControlViewSheetOptions class instance
  ASheetOptions := dxGanttControl1.ViewChart.OptionsSheet;
  // Creates custom fields for all available attributes declared in the XML file
  ASheetOptions.RetrieveMissingExtendedAttributeColumns;
    // Iterates through the first summary task and its subtasks
    for I := 1 to 6 do
      begin
        ATask := dxGanttControl1.DataModel.Tasks.Items[I];
        // Displays the Text1 field values in the cxMemo editor
        cxMemo1.Lines.Add(ATask.ExtendedAttributes.Items['Text1'].Value);
      end;
end;

Refer to the TdxGanttControlExtendedAttributeCFType description for details.

See Also