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: June 24, 2019).
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:

Created:

Updated:

Platform:

Replies:

146372 Aug 1,2019 06:20 PM UTC Aug 2,2019 11:09 AM UTC Xamarin.Forms 1
loading
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, 
  
[Xaml 
  
<dataGrid:SfDataGrid HeaderRowHeight="100"> 
    <dataGrid:SfDataGrid.Columns  x:TypeArguments="syncfusion:Columns"> 
        <dataGrid:GridTextColumn  
                                             MappingName="OrderID" 
                                             Padding="0,0,0,0"> 
            <dataGrid:GridTextColumn.HeaderTemplate> 
               <DataTemplate> 
                <Label Text="OrderID"  
                       HorizontalOptions="Center" 
                       VerticalOptions="Center" 
                       Rotation="90" 
                       LineBreakMode="WordWrap" 
                       TextColor="Black"/> 
                </DataTemplate> 
            </dataGrid:GridTextColumn.HeaderTemplate> 
        </dataGrid:GridTextColumn> 
   </dataGrid:SfDataGrid.Columns> 
</dataGrid:SfDataGrid> 
             
 
We have attached the sample
for your reference, 
 
  
 
  
We hope that this helps, please let us know if you would require any assistance. 
 
Regards,
Subburaj Pandian V  


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.

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