Articles in this section

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

Header text


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

void gridGroupingControl1_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e)
{
  int field = e.TableControl.TableDescriptor.ColIndexToField(e.Inner.ColIndex);
  MessageBox.Show(e.TableControl.TableDescriptor.Columns[field].HeaderText);
}
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)
Access denied
Access denied