Articles in this section
Category / Section

How to change the alignment of column header in WinForms MultiColumnComboBox?

1 min read

Change the alignment of column header

In WinForms MultiColumn ComboBox, 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 in WinForms MultiColumn ComboBox

Figure 1. Column Header alignment is specified as Right.

Samples:

C#: MultiColumnComboBox_HeaderAlign_C#

VB: MultiColumnComboBox_HeaderAlign_VB

 

Conclusion

I hope you enjoyed learning about how to change the alignment of column header in WinForms MultiColumn ComboBox.

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

For current customers, you can check out our WinForms 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 MultiColumn ComboBox and other WinForms components.

If you have any queries or require clarifications, please let us know in comments below. You can also contact us through our support forums, Direct-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)
Please sign in to leave a comment
Access denied
Access denied