)
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 change the header text in a WinForms GridListControl?

Platform: WinForms |
Control: GridListControl |
Published Date: April 30, 2011 |
Last Revised Date: January 2, 2020
Tags: headertext

Change the header text

The column header text of the GridListControl can be changed by setting the text property of header cell in PrepareViewStyleInfo event of GridListControl.

C#

//Triggering the event.
this.gridListControl1.Grid.PrepareViewStyleInfo += Grid_PrepareViewStyleInfo;
 
//Event customization.
void Grid_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
    //Check whether cell is header cell or not.
    if(e.ColIndex == 1 && e.RowIndex == 0)
    {
        e.Style.Text = "Header";
    }
}

 

VB

'Triggering the event.
Private Me.gridListControl1.Grid.PrepareViewStyleInfo += AddressOf Grid_PrepareViewStyleInfo
 
'Event customization.
Private Sub Grid_PrepareViewStyleInfo(ByVal sender As Object, ByVal e As GridPrepareViewStyleInfoEventArgs)
 'Check whether cell is header cell or not.
 If e.ColIndex = 1 AndAlso e.RowIndex = 0 Then
  e.Style.Text = "Header"
 End If
End Sub

 

Screenshot

Change the header text in GridListControl

Samples:

C#: GridListControl CS

VB: GridListControl VB

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