Back to Devexpress

TdxGanttControlTaskPredecessorLinks.GetItemByPredecessorUID(Integer) Method

vcl-dxganttcontroltasks-dot-tdxganttcontroltaskpredecessorlinks-dot-getitembypredecessoruid-x28-system-dot-integer-x29.md

latest2.2 KB
Original Source

TdxGanttControlTaskPredecessorLinks.GetItemByPredecessorUID(Integer) Method

Returns a dependency by its predecessor’s unique identifier.

Declaration

delphi
function GetItemByPredecessorUID(const AUID: Integer): TdxGanttControlTaskPredecessorLink;

Parameters

NameType
AUIDInteger

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:

delphi
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;
cpp
for (int I = 0; I < dxGanttControl1->DataModel->Tasks->Count; I++)
  {
    TdxGanttControlTaskPredecessorLinks *ACollection = dxGanttControl1->DataModel->Tasks->Items[I]->PredecessorLinks;
    TdxGanttControlTaskPredecessorLink *ADependency = ACollection->GetItemByPredecessorUID(1);
    if (ADependency != NULL)
      ADependency->Type = TdxGanttControlTaskPredecessorLinkType::SS;
  }

See Also

TdxGanttControlTaskPredecessorLinks Class

TdxGanttControlTaskPredecessorLinks Members

dxGanttControlTasks Unit