We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to hide the row headers of the ChildTable in the WinForms GridGroupingControl?

Platform: WinForms |
Control: GridGroupingControl |
Published Date: April 30, 2011 |
Last Revised Date: February 13, 2020

Hide the row headers

The GridGroupingControl does not have direct support to hide the row headers of the child tables. To hide the Row Headers of the child table, there is a simple solution.

Solution:

You can access the Child Table by using the GridTableModel. Then handle the QueryColWidth of the ChildTable and hide the RowHeader, that is Column zero, by setting the Size property to Zero.

C#

//Gets the ChildTable Model in the Form_Load.
GridTableModel tbl = this.gridGroupingControl1.GetTableModel("ChildTable");
//Hooks the QueryColWidth event to change the width of the Child Table row header.
tbl.QueryColWidth += new GridRowColSizeEventHandler(tbl_QueryColWidth);
//Child Table QueryColWidth event Handler.
private void tbl_QueryColWidth(object sender, GridRowColSizeEventArgs e)
{
   //Checks the col index == 0 to identify.
   if(e.Index == 0)
   {
      //Sets the size of the RowHeader width to zero.
      e.Size = 0;
      e.Handled = true;
   }
}

VB

'Gets the ChildTable Model in the Form_Load.
Private tbl As GridTableModel = Me.gridGroupingControl1.GetTableModel("ChildTable")
'Hooks the QueryColWidth event to change the width of the Child Table row header.
Private tbl.QueryColWidth += New GridRowColSizeEventHandler(AddressOf tbl_QueryColWidth)
'Child Table QueryColWidth event Handler.
Private Sub tbl_QueryColWidth(ByVal sender As Object, ByVal e As GridRowColSizeEventArgs)
   'Checks the col index == 0 to identify. 
   If e.Index = 0 Then
      'Sets the size of the RowHeader width to zero.
      e.Size = 0
      e.Handled = True
   End If
End Sub

Hide the row header in the child table

Figure 1: RowHeader hidden in the ChildTable

Samples:

C#: HideRowHeaders

VB: HideRowHeaders

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon