vcl-cxcustomdata-dot-tcxdatacontrollergroups.md
Returns the index of a specific child data group.
property ChildDataGroupIndex[ParentDataGroupIndex: TcxDataGroupIndex; ChildIndex: Integer]: TcxDataGroupIndex read;
| Type |
|---|
| TcxDataGroupIndex |
This property returns the index of the specific child data group belonging to the parent data group addressed by the ParentDataGroupIndex parameter. The number of children of the parent data group is defined via its ChildCount property. The ChildIndex parameter can vary from 0 to (ChildCount - 1 ). To return a child data group at level 0 you need to pass value -1 for the ParentDataGroupIndex parameter. The ChildDataGroupIndex property returns -1 if it cannot locate a child for the parent data group.
The ParentDataGroupIndex property returns the index of the parent data group.
Consider a grid control displayed in the following image:
For this sample grid:
ChildDataGroupIndex[-1, 1] returns 2 (the ‘EXCHANGE: NYSE’ row)
ChildDataGroupIndex[2, 0] returns 3 (the first child of the ‘EXCHANGE: NYSE’ row)
ChildDataGroupIndex[1, 1] returns -1 (there is only one child for the ‘RISK : MED’ row)
See Also
TcxDataControllerGroups.ChildCount
TcxDataControllerGroups.ParentDataGroupIndex