How to change the alignment of column header in WinForms MultiColumnComboBox?
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
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!