How to change the header text in a WinForms GridListControl?
Change the header text
The column header text of the https://www.syncfusion.com/winforms-ui-controls/grid-controlWinForms 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
Samples:
Conclusion
I hope you enjoyed learning about how to get triggers the event when a toolbar is dragged to a float state in WinForms CommandBar.
You can refer to our WinForms GridList’s feature tour page to know about its other groundbreaking feature representations. You can also explore our WinForms GridList 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 forums, Direct-Trac, or feedback portal. We are always happy to assist you!