Skip to main content

TcxCustomTreeList.OnIsGroupNode Event

Allows you to specify group nodes.

Declaration

property OnIsGroupNode: TcxTreeListIsGroupNodeEvent read; write;

Remarks

A group node displays a category value in one data cell that occupies the entire node area. The number of data cells in an ordinary node matches the number of grid columns.

You can handle the OnIsGroupNode event to change the group status of a node based on certain conditions.

Event Occurrence

The OnIsGroupNode event occurs every time the tree list control is about to determine if a node is a group node.

Note

The OnIsGroupNode event can occur only if the OptionsView.PaintStyle property is set to tlpsCategorized. Group nodes are always displayed as ordinary nodes when the standard paint style is active.

Event Parameters

You can use Sender and ANode parameters to identify and access the tree list control that raised the OnIsGroupNode event and the currently processed node. The IsGroup parameter allows you to specify if the currently processed node (ANode) is a group node.

Refer to the TcxTreeListIsGroupNodeEvent procedural type description for detailed information on parameters accessible within OnIsGroupNode event handlers.

Code Examples

Define Individual Nodes as Group Nodes

The following code example defines Node1 as a group node:

procedure TForm1.cxDBTreeList1IsGroupNode(Sender: TcxCustomTreeList;
  ANode: TcxTreeListNode; var IsGroup: Boolean);
begin
  if ANode.Values[cxDBTreeList1DataField.ItemIndex] = 'Node1' then
     IsGroup := True;
end;

VCL Tree List: An Individual Group Node Example

Define Root Level Nodes as Group Nodes

The following code example defines all nodes at the root level as group nodes:

procedure TForm1.cxDBTreeList1IsGroupNode(Sender: TcxCustomTreeList;
  ANode: TcxTreeListNode; var IsGroup: Boolean);
begin
  IsGroup := ANode.Level = 0;
end;

VCL Tree List: An Example with All Root Level Group Nodes

See Also