)
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 customize the column header text in WinForms MultiColumnComboBox?

Platform: WinForms |
Control: MultiColumnComboBox |
Published Date: January 28, 2016 |
Last Revised Date: January 6, 2020

Customize the column header

In 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

 

Customize the specific cell of the column header

Figure 1. The specific cell of the column header is customized.

Samples:

C#: MultiColumnComboBox_HeaderCaption_Customization_C#

VB: MultiColumnComboBox_HeaderCaption_Customization_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