Articles in this section

How to change the header text in a WinForms GridListControl?

Change the header text


The column header text of the WinForms 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.
AddHandler 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
Header text screenshot as shown below

Change the header text in GridListControl


Samples:

C#: GridListControl CS

VB: GridListControl VB


Conclusion


I hope you enjoyed learning about how to change the header text in GridListControl.


You can refer to our WinForms GridListControl feature tour page to know about its other groundbreaking feature representations. You can also explore our WinForms GridListControl documentation to understand how to present and manipulate data.


For current customers, you can check out our WinForms components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our WinForms GridList and other WinForms components.

 

If you have any queries or require clarifications, please let us know in the comment section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

 

 

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