RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomClientDataSet.GetGroupState Method

Indicates where the current record sits within a specified group of records.

Pascal
function GetGroupState(Level: Integer): TGroupPosInds;
C++
__fastcall TGroupPosInds GetGroupState(int Level);

Call GetGroupState to determine where the current record falls in the group of records specified by the Level parameter.  

Level identifies a group by its grouping level on the current index. Grouping level 1 is the set of records with the same value on the first field in the index. Grouping level 2 is the set of records with the same values on the first two fields in the index, and so on. If Level specifies a grouping level greater than the GroupingLevel property, GetGroupState raises an exception. 

GetGroupState returns a set that indicates where the current record falls in the current grouping level. It has one of the following values:

Value 
Meaning 
[gbMiddle]  
The current record is neither the first nor the last in the group.  
[gbFirst]  
The current record is the first in the group, which contains at least two records.  
[gbLast]  
The current record is the last in the group, which contains at least two records.  
[gbFirst,gbLast]  
The current record is the only record in the group.  

Note: If AggregatesActive is false or the current index does not support grouping, GetGroupState returns an empty set.
 

GroupingLevel 

IndexName 

GroupingLevel 

AggregatesActive 

Obtaining Aggregate Values 

Using Indexes to Group Data

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!