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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to change the orientation of the header text of column?

Thread ID:





146372 Aug 1,2019 06:20 PM UTC Nov 12,2020 12:40 PM UTC Xamarin.Forms 3
Tags: SfDataGrid
Hassan Tariq
Asked On August 1, 2019 06:20 PM UTC

Here are screenshots

Attachment: Archive_5e5cf919.zip

Subburaj Pandian Veluchamy [Syncfusion]
Replied On August 2, 2019 11:09 AM UTC

Hi Hassan Tariq, 
Thank you for contacting Syncfusion support. 
We don’t have direct support for your requirement of changing orientation of DataGrid Header Text and it can be achieved using “HeaderTemplate” support in each DataColumn in SfDataGrid. By defining the label as the header template as a DataTemplate and set the rotation property value “-90” or “90” to make a rotation. You can change the rotation value based on your requirement. However we need to manual define the header row height to avoid text clipping in view, because we didn’t have the support for “DataTemplate” auto sizing the height. 
Please refer the following code snippet, 
<dataGrid:SfDataGrid HeaderRowHeight="100"> 
    <dataGrid:SfDataGrid.Columns  x:TypeArguments="syncfusion:Columns"> 
                <Label Text="OrderID"  
We have attached the sample
for your reference, 
We hope that this helps, please let us know if you would require any assistance. 
Subburaj Pandian V  

Replied On November 11, 2020 03:37 PM UTC

Is there a way to control the width of the columns? The column's width seems to match the label width as if it wasn't rotated. I tried setting ColumnSizer="None" but then my label text gets wrapped to a second and 3rd line if they're too long. If I set LineBreakMode="NoWrap" then the text gets truncated. This is what I'm trying to achieve:

Karthikraja Kalaimani [Syncfusion]
Replied On November 12, 2020 12:40 PM UTC

Hi Eddy,

Please set the columnsizer as Auto, so it will set the column width based on content width. Please refer the below UG document.


Karthik Raja


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

Live Chat Icon For mobile
Live Chat Icon