Skip to main content

TdxGanttControlTaskPredecessorLinks.GetItemByPredecessorUID(Integer) Method

Returns a dependency by its predecessor’s unique identifier.

Declaration

function GetItemByPredecessorUID(const AUID: Integer): TdxGanttControlTaskPredecessorLink;

Parameters

Name Type
AUID Integer

Returns

Type
TdxGanttControlTaskPredecessorLink

Remarks

Predecessor task is a task that a dependency links with succeeding task(s).

Call this function and pass a predecessor tasks’s unique identifier to obtain all dependencies that belong to this task. Otherwise, the functuion resturns nil.

The code example below shows how you can change type of multiple dependecies that have the same predecessor:

var
  ADependency: TdxGanttControlTaskPredecessorLink;
  ACollection: TdxGanttControlTaskPredecessorLinks;
  I: Integer;
begin
  for I := 0 to dxGanttControl1.DataModel.Tasks.Count - 1 do
  begin
    ACollection := dxGanttControl1.DataModel.Tasks.Items[I].PredecessorLinks;
    ADependency := ACollection.GetItemByPredecessorUID(1);
    if ADependency <> nil then
      ADependency.&Type := TdxGanttControlTaskPredecessorLinkType.SS;
  end;
See Also