)
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 alignment of column header in WinForms MultiColumnComboBox?

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

Change the alignment of column header

In MultiColumnComboBox, the column header alignment can be customized by handling the QueryCellInfo event of the GridListBox in MultiColumnComboBox.

C#

//To specify the style.
(this.multiColumnComboBox1.ListControl as GridListBox).Grid.Model.QueryCellInfo += new Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventHandler(Model_QueryCellInfo);
 
private void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
     //To align the column header Of MultiColumnComboBox
     if (e.RowIndex == 0)
     {
         e.Style.HorizontalAlignment = GridHorizontalAlignment.Right;
         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 GridQueryCellInfoEventArgs)
     'To align the column header Of MultiColumnComboBox
     If e.RowIndex = 0 Then
       e.Style.HorizontalAlignment = GridHorizontalAlignment.Right
       e.Style.TextColor = Color.Red
     End If
End Sub

 

Column header alignment is specified as right

Figure 1. Column Header alignment is specified as Right.

Samples:

C#: MultiColumnComboBox_HeaderAlign_C#

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