How to Access the Group from the Record

3 Jan 2020 / 1 minute to read

To access the group from the record, use the following code snippet.

//For all the display elements in the Table.
foreach(Element el in gridGroupingControl1.Table.DisplayElements)
//DisplayElementKind.Record or DisplayElementKind.Summary.
    if(el.Kind==DisplayElementKind.Record || DisplayElementKind.Summary)
        Group g = el.ParentGroup;
'For all the display elements in the Table.
For Each el As Element In gridGroupingControl1.Table.DisplayElements

'DisplayElementKind.Record or DisplayElementKind.Summary.
If el.Kind=DisplayElementKind.Record OrElse el.Kind=DisplayElementKind.Summary Then
Dim g As Group = el.ParentGroup
End If
Next el