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.
Unfortunately, activation email could not send to your email. Please try again.

Align the column headers

Thread ID:

Created:

Updated:

Platform:

Replies:

129092 Feb 26,2017 06:04 PM Mar 1,2017 01:01 AM Windows Forms 3
loading
Tags: GridGroupingControl
Wolfgang Anthony Eiden
Asked On February 26, 2017 06:04 PM

Hello,

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.

Greetings

Wolfgang

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

Hi Wolfgang, 

Thanks for your interest in Syncfusion products. 

Query 
Response 
 
 
 
 
 
 
 
 
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: 
 
Regards, 
Piruthiviraj 


Wolfgang Anthony Eiden
Replied On February 28, 2017 08:04 AM

Thank you. Works fine.

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

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. 

Regards, 
Piruthiviraj 


CONFIRMATION

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.

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.

;