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
close icon

Customizing Text positioning

Hey,

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?


Cheers,

Luuk

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. 

Regards, 
Ashok 



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

Hi,

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.

Thanks,
Joan


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:SfDataGrid.Columns> 
        <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" /> 
    </sfGrid:SfDataGrid.Columns> 
</sfGrid:SfDataGrid> 
 
 
Also, we have prepared a simple sample for your reference and you can dwonload the same from the below link. 
 
 
 
Regards, 
Divakar. 
 


Loader.
Live Chat Icon For mobile
Up arrow icon