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

Customizing Text positioning


I would like to align the text inside the datagrids to the left and not middle. How am I able to achieve this with the style property?



4 Replies

LU Luuk January 13, 2017 11:03 AM UTC

nvm wasn't looking right it was right in the mapping properties

AN Ashok N Syncfusion Team January 16, 2017 12:33 PM UTC

Hi Luuk, 

Thanks for contacting Syncfusion support. 

We have checked your query and in our SfDataGrid we have used customized view. So, default implicit style was not work for customize view. You can achieve your requirement by setting GridColumn.TextAlignment as TextAlignment.Start. 


JL Joan Lopez January 31, 2017 01:03 PM UTC


How can I align a switch column?

For example to display the switch button cetered.

I've tried with TextAlignment but it doesn't work.


DS Divakar Subramaniam Syncfusion Team February 1, 2017 04:51 AM UTC

Hi Joan, 
We have checked your query. You can achieve your requirement by setting padding for GridSwitchColumn. Please refer the below code snippet. 
<sfGrid:SfDataGrid x:Name="dataGrid" AutoGenerateColumns="False"> 
        <sfGrid:GridTextColumn MappingName="OrderID" /> 
        <sfGrid:GridTextColumn MappingName="CustomerID" /> 
        <sfGrid:GridSwitchColumn MappingName="IsClosed" Padding="15,0,0,0" /> 
        <sfGrid:GridTextColumn MappingName="Freight" /> 
        <sfGrid:GridTextColumn MappingName="Country" /> 
Also, we have prepared a simple sample for your reference and you can dwonload the same from the below link. 

Live Chat Icon For mobile
Up arrow icon