How to Access the Group from DisplayElements

3 Jan 20201 minute to read

To access the group from DisplayElements, 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