Processing Group Rows
- 2 minutes to read
#Group Rows and Group Levels
When grouping is applied, group rows organize data into a tree. Group rows are virtual objects. They do not exist in the grid's data source. Group rows are automatically created when data grouping is applied, to combine records with identical values within grouping columns. Ungrouping data automatically removes group rows. Data rows are displayed at the bottommost hierarchy level and can be accessed by expanding group rows.
Group rows are uniquely identified by their handles. Group row handles are negative (starting from -1), determining the order in which group rows appear within a View according to the sorting and filtering settings. To learn more, see Identifying Rows.
To determine whether a row handle corresponds to a group row or not, use the GridControl.IsGroupRowHandle method. To obtain a grouping level at which a row (group or data row) resides, use the GridControl.GetRowLevelByRowHandle or GridControl.GetRowLevelByVisibleIndex method.
#Iterating Through Child Rows
To iterate through child rows belonging to a group row, use the following methods.
- GridControl.GetChildRowCount - Returns a number of child rows (group or data) contained within a specified group row.
- GridControl.GetChildRowHandle - Returns a handle of the row contained within a specified group row at a specified position.
- GridControl.GetParentRowHandle - Returns a handle of the group row that owns a specified group or data row.