cxTreeList에서 노드를 검색한후에 하위(Child)의 내용을 검사한다.

cxTreeList에서 노드를 검색한후에 하위(Child)의 내용을 검사한다.

procedure TForm1.Button1Click(Sender: TObject); 
 var
  I: Integer;
  노드, 노드2 : TcxTreeListNode;
begin
  for I := 0 to cxTreeList1.AbsoluteCount - 1 do
  begin
    if cxTreeList1.AbsoluteItems[i].Values[0] = '작업1' then
    begin
      노드 := cxTreeList1.AbsoluteItems[i];
      Break;
    end;

  end;

  노드2 := 노드.getFirstChild;
  while 노드2 <> nil do
  begin
    if  노드2.Values[0] = '2' then
      Break;
    노드2 := 노드.GetNextChild( 노드2 );
  end;


  if 노드2 <> nil then
    노드.AddChild;

end;

 

Author: yyjksw