Skip to content

GroupRow Property

See Also

GridGroupRow Object

See Also

Grid Control ActiveX Control v24.0

Description

Indicates whether the row is a group row.

Property Type

Read-only property

Syntax (Visual Basic)

Public Property GroupRow() As Boolean

Remarks

Since this object is a GroupRow, the GroupRow property will always return True.

A GroupRow of the GridControl is a row which has no associated GridRecord, but has a special text caption instead. The special text caption depends on whether the GroupCaption property has been set for the GridRecordItems that belong to the group. If a GroupCaption has been set, then that is displayed as the special text; otherwise, the caption of the GridColumn is used.

You might need to test if a row is a GroupRow when iterating through the GridControl's collection of rows to determine if the row has a Record you can access. If your rows are grouped and you try to access the Record of a GroupRow, your program will crash.

Example

How to Determine if a Row is a GroupRow (Visual Basic)

This sample illustrates how you could use the GroupRow property to test if a row is a group row.

Dim Row As GridRow  
Dim GroupRow As GridGroupRow  

' Iterate through the GridControl's collection of GridRow objects  
For Each Row In wndGridControl.Rows  
    ' If the row is not a GroupRow then execute this code  
    ' If the rows are grouped, this check has to be made before working with  
    ' the GridRecord of the row  
    If Row.GroupRow = False Then  
        ' Print the caption of the 4th GridRecordItem of the attached GridRecord  
        Debug.Print "Record Caption: " & Row.Record.Item(3).Caption  
    Else  
        Set GroupRow = Row  
        Debug.Print "Group Caption: " & GroupRow.GroupCaption  
    End If  
Next

See Also

GridGroupRow Object


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.