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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Align the column headers

Thread ID:





129092 Feb 26,2017 11:04 PM UTC Mar 1,2017 06:01 AM UTC WinForms 3
Tags: GridGroupingControl
Wolfgang Anthony Eiden
Asked On February 26, 2017 11:04 PM UTC


it's no problem to align to content of a cell. But how is it possible to align each column header text (left or right, not centering)?
I am using the latest api and vb.net.



Piruthiviraj Malaimelraj [Syncfusion]
Replied On February 27, 2017 10:30 AM UTC

Hi Wolfgang, 

Thanks for your interest in Syncfusion products. 

How is it possible to align each column header text (left or right, not centering)? 
Suggestion 1: 
In order to align the header text at right/left/center side of the cell, HorizontalAlignment property of GridGroupingControl.Appearance.ColumnHeaderCell can be used.  
Code example: 
Me.gridGroupingControl1.Appearance.ColumnHeaderCell.HorizontalAlignment = Syncfusion.Windows.Forms.Grid.GridHorizontalAlignment.Right 

Suggestion 2: 
The header text can be aligned by using HorizontalAlignment property in QueryCellStyleInfo event also. 
Code example: 
AddHandler Me.gridGroupingControl1.QueryCellStyleInfo, AddressOf gridGroupingControl1_QueryCellStyleInfo 
Private Sub gridGroupingControl1_QueryCellStyleInfo(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs) 
                If e.TableCellIdentity.DisplayElement.Kind = Syncfusion.Grouping.DisplayElementKind.ColumnHeader Then 
                                e.Style.HorizontalAlignment = Syncfusion.Windows.Forms.Grid.GridHorizontalAlignment.Right 
                End If 
End Sub 


Sample link: 

Wolfgang Anthony Eiden
Replied On February 28, 2017 01:04 PM UTC

Thank you. Works fine.

Piruthiviraj Malaimelraj [Syncfusion]
Replied On March 1, 2017 06:01 AM UTC

Hi Wolfgang, 

Thanks for the update. 

We are glad to hear that the provided solution is resolved your scenario. Please let us know if you have any other queries. 



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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