How to highlight a GroupHeader section when the GroupHeader is clicked in WinForms GridGroupingControl?
Highlight the group header
You can
highlight a GroupHeader section when the group header is
clicked by using TableControlCellClick event. You can check if
the selection is a GroupCaptionCell and can highlight
the GroupHeader.
void gridGroupingControl1_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e)
{
GridTableCellStyleInfo style = e.TableControl.Model[e.Inner.RowIndex, e.Inner.ColIndex];
if(style.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionCell)
{
e.TableControl.Selections.Add(GridRangeInfo.Row(e.Inner.RowIndex));
Console.WriteLine("Header clicked");
}
}Private Sub gridGroupingControl1_TableControlCellClick(ByVal sender As Object, ByVal e As GridTableControlCellClickEventArgs)
Dim style As GridTableCellStyleInfo = e.TableControl.Model(e.Inner.RowIndex, e.Inner.ColIndex)
If style.TableCellIdentity.TableCellType = GridTableCellType.GroupCaptionCell Then
e.TableControl.Selections.Add(GridRangeInfo.Row(e.Inner.RowIndex))
Console.WriteLine("Header clicked")
End If
End SubThe screenshot below displays the highlighting of the group header in GGC.

Samples:
C#: GroupHeader-C#
VB: GroupHeader-VB