Skip to main content
A newer version of this page is available.

Example: TreeList.ColumnByName

The following sample adds a new child node and sets a value of a cell within the node. The cell belongs to a column provided by the ColumnByName property. The AddNode method accepts the following parameters:

AParent represents a node to which the new child node is added.

AValue represents the value for the cell.

Note that the sample requires that a “Notes” column exists.

procedure AddNode(AParent: TcxTreeListNode, AValue: string);
begin
  AParent.AddChild;
  cxTreeList.ColumnByName('Notes').Value := AValue;
end;