Articles in this section
Category / Section

How to retrieve the column header text of a clicked cell in the WinForms GridGroupingControl?

1 min read

Header text

The header text of a column in grouped rows can be retrieved in the TableControlCellClick event by using the HeaderText property.

C#

void gridGroupingControl1_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e)
{
  int field = e.TableControl.TableDescriptor.ColIndexToField(e.Inner.ColIndex);
  MessageBox.Show(e.TableControl.TableDescriptor.Columns[field].HeaderText);
}

VB

Private Sub gridGroupingControl1_TableControlCellClick(ByVal sender As Object, ByVal e As GridTableControlCellClickEventArgs)
   Dim field As Integer = e.TableControl.TableDescriptor.ColIndexToField(e.Inner.ColIndex)
   MessageBox.Show(e.TableControl.TableDescriptor.Columns(field).HeaderText)
End Sub

Samples:

C#: HeaderText-C#

VB: HeaderText-VB

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied