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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Text Alignment

Thread ID:





125126 Jul 23,2016 11:00 AM UTC Jul 26,2016 09:13 PM UTC Xamarin.Android 3
Tags: SfDataGrid
Mohamad Razif Hussin
Asked On July 23, 2016 11:00 AM UTC

How to get TextAlignment like column money in the image below in sfdatagrid for Xamarin.Android? it aligned correctly if i use sfdatagrid for Xamarin.Forms but not with Xamarin.Android

this is the code i tried using Xamarin.Android:
var colMoney = new GridTextColumn()
Width = 131,
MappingName = "Money",
HeaderText = "Money",
Format = "#,##0.00;(#,##0.00)", 
TextAlignment = GravityFlags.Right  // GravityFlags.End
and this what happen for both GravityFlags.Right and GravityFlags.End:

It will be Top and Right aligned. i want to set center(vertical) and right(horizontal) like in the Xamarin.Forms
anybody can help? Thank you in advance.

Vimal Prabhu Manohkaran [Syncfusion]
Replied On July 26, 2016 06:53 AM UTC

Hi Mohamad Razif,

Thank you for contacting Syncfusion Support.

Your requirement of center aligning text in SfDataGrid is possible. In Xamarin.Android it is required to specify multiple gravity flags in order to achieve the reported behavior. Please refer the following code example to achieve your requirement of text alignment.

GridTextColumn orderIdColumn = new GridTextColumn(); 
orderIdColumn.TextAlignment = GravityFlags.End | GravityFlags.CenterVertical; 

Vimal Prabhu

Mohamad Razif Hussin
Replied On July 26, 2016 10:10 AM UTC

It works. Thank you very much. 

Vimal Prabhu Manohkaran [Syncfusion]
Replied On July 26, 2016 09:13 PM UTC

Hi Muhamad,

Thanks for the update. We are happy and glad that we were able to help you.

Vimal Prabhu


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