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

GridNumericColumn text vertically center align

Hi,
I have a SfDataGrid with Text, Numeric, Combobox, Datetime and checkbox columns. Combobox and checkbox columns are centered aligned both vertically and horizontally. But for Text, Numeric columns TextAlignment="Center" works only horizontally. Is there anyway I can center align in both axes for textumeric columns in all modes(readonly\edit). Also a side note, Datetime column on edit, center aligns the text in both axes. I am attaching some screen shots for visual difference. 

Attachment: SFDataGrid_alignment_1a4d36a4.zip

1 Reply

MK Muthukumar Kalyanasundaram Syncfusion Team April 28, 2015 01:14 PM UTC

Hi Vasanth,

Thank you for usingSyncfusion products.

In readonly mode, the Text and Numeric column works horizontal only while setting TextAlignment as Center


We analyzed your query. If we set TextAlignment property as center, it will aligned the text horizontal only. So you can set theVerticalAlignmentproperty also forchanging the vertical alignment. Please refer the below code:

Code:

<syncfusion:SfDataGrid.Columns>

<!--Text column-->

<syncfusion:GridTextColumnMappingName="ProductName"VerticalAlignment="Center"TextAlignment="Center"/>

<!--ComboBox Column-->

<syncfusion:GridComboBoxColumnItemsSource="{StaticResourceShipCountries}"VerticalAlignment="Center"TextAlignment="Center"MappingName="ShipCountry"/>

<!--Numeric Column-->

<syncfusion:GridNumericColumnMappingName="Freight"VerticalAlignment="Center"TextAlignment="Center"/>

<!--DateTime Column-->

<syncfusion:GridDateTimeColumnMappingName="ShippedDate"VerticalAlignment="Center"TextAlignment="Center" />

<!--CheckBox Column-->

<syncfusion:GridCheckBoxColumnMappingName="IsClosed"VerticalAlignment="Center"TextAlignment="Center"/>

</syncfusion:SfDataGrid.Columns>

Please refer the attached sample.

Sample:http://www.syncfusion.com/downloads/support/forum/118950/WinRTGridColumns1788603616.zip

In edit mode while setting TextAlignment as Center, the columns are not aligned as center


Weare able to reproduce the reported issueonour end. We have logged defect report regarding this query. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates,


https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents



Please let me know if you have any questions.

Regards,

Muthukumar K


Loader.
Live Chat Icon For mobile
Up arrow icon