2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
Customize the column headerIn MultiColumnComboBox, the column header can be customized by handling the QueryCellInfo event of the GridListBox in MultiColumnComboBox.
Note: The default name of the column header is assigned from the ColumnName of the DataTable.
The following code example demonstrates the same. C# //To specify the style. (this.multiColumnComboBox1.ListControl as GridListBox).Grid.Model.QueryCellInfo += new Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventHandler(Model_QueryCellInfo); void Model_QueryCellInfo(object sender, Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventArgs e) { //To specify the row and colum index. if (e.RowIndex == 0 && e.ColIndex == 1) { //To specify the font e.Style.Font = new Syncfusion.Windows.Forms.Grid.GridFontInfo(new Font("Segoe UI", 15, FontStyle.Bold, GraphicsUnit.Pixel)); //To specify the text e.Style.Text = "Name"; //To specify the text color. e.Style.TextColor = Color.Red; } }
VB 'To specify the style. AddHandler TryCast(multiColumnComboBox1.ListControl, GridListBox).Grid.Model.QueryCellInfo, AddressOf Model_QueryCellInfo Private Sub Model_QueryCellInfo(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventArgs) 'To specify the row and colum index. If e.RowIndex = 0 AndAlso e.ColIndex = 1 Then 'To specify the font e.Style.Font = New Syncfusion.Windows.Forms.Grid.GridFontInfo(New Font("Segoe UI", 15, FontStyle.Bold, GraphicsUnit.Pixel)) 'To specify the text e.Style.Text = "Name" 'To specify the text color. e.Style.TextColor = Color.Red End If End Sub
Figure 1. The specific cell of the column header is customized. Samples: |
2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.