The following sample uses the OnIsGroupNode event. The event handler checks whether the current node is a root level node and, if so, the handler makes it a group node.
Note that it is necessary to set the PaintStyle to tlpsCategorized.
procedure <Form>.<TreeList>IsGroupNode(Sender: TcxCustomTreeList;
ANode: TcxTreeListNode; var IsGroup: Boolean);
begin
IsGroup := ANode.Level = 0;
end;
void __fastcall <Form>::<TreeList>IsGroupNode(TcxCustomTreeList *Sender, TcxTreeListNode *ANode, bool &IsGroup) {
IsGroup = (ANode->Level == 0);
}