The following sample uses the OnGetContentStyle event. The event handler assigns a style to the current node depending on whether it is a group node.
Note that the sample requires an instance of the style repository. The repository should contain the following two styles: styCategory (which is used for group nodes) and styTask (used for the other nodes).
procedure <Form>.<TreeList>StylesGetContentStyle(Sender: TcxCustomTreeList; AColumn: TcxTreeListColumn; ANode: TcxTreeListNode; var AStyle: TcxStyle);
begin
if ANode.IsGroupNode then
AStyle := styCategory
else
AStyle := styTask;
end;
void __fastcall <Form>::<TreeList>StylesGetContentStyle(TcxCustomTreeList *Sender, TcxTreeListColumn *AColumn, TcxTreeListNode *ANode, TcxStyle *&AStyle) {
if (ANode->IsGroupNode) {
AStyle = styCategory;
} else {
AStyle = styTask;
}
}