TdxGanttControlExtendedAttribute Class
A custom field attribute.
Declaration
TdxGanttControlExtendedAttribute = class(
TdxGanttControlModelElementListItem
)
Remarks
Extended attributes are XML elements that allow you to add information about a task, resource, or assignment (for instance, expenses related to a task/resource or a text description).
The control converts extended attributes differently depending on which element they belong to:
A task or resource. In this case, an extended attribute is converted to a custom field that users can add to a sheet in the Chart View or Resource Sheet View
An assignment. In this case, an extended attribute is a non-visual element whose settings you can adjust only in code. These elements store information in the same way as custom fields do. Regardless of these elements are not displayed in the control, they are also considered custom fields.
Custom Field Definition
All information related to a chart, including custom fields, is stored in an XML file. You can call the LoadFromFile or LoadFromStream procedure to upload a chart to the control.
In an XML structure, custom fields are stored in a collection that corresponds to the ExtendedAttributes
element. A custom field is the collection’s ExtendedAttribute
child element that contains attributes aimed to adjust field settings.
The XML-structure snippet below defines the Comment column settings in the Chart View’s sheet (see the image above):
<ExtendedAttributes>
<ExtendedAttribute>
<FieldName>Text1</FieldName>
<Alias>Comment</Alias>
</ExtendedAttribute>
</ExtendedAttributes>
You can open the ExtendedAttributesDemo.xml file in the ExpressGanttControl demo’s Data folder to see the full XML structure.
Limitations
VCL Gantt Control supports only certain custom field features, and most attributes are not intended for direct use. Do not change an attribute value that has no mapped API in the control because this can cause errors.
API
The TdxGanttControlExtendedAttribute class includes API members that allow you to do the following:
- Specify the column name (FieldName).
- Replace the column name with the custom caption (Alias).
- Specify the column’s owner (Level).
The following API members reference a TdxGanttControlExtendedAttribute object:
- An extended attribute collection‘s Items property
- The ExtendedAttribute property of an extended attribute’s value