I have an s:DataGrid with 3 columns. I’d like to right align the text in the last two columns but can’t find a way to get it working. I’ve tried creating a custom renderer and setting the textAlign to right, but it doesn’t work.
Here’s my custom renderer:
<?xml version="1.0" encoding="utf-8"?>
<fx:Script>
<![CDATA[
]]>
</fx:Script>
<s:Label id="lblData" top="9" left="7" text="{data.outgoingCount}" fontWeight="bold" textAlign="right"/>
I would really like to know how to right align cells in the grid. Thanks for anyone who can help.
If you only need to show text, take a look at the DefaultGridItemRenderer class. If you don’t specify an item renderer, this is what the Spark
DataGridwill use.DefaultGridItemRendererhas atextAlignstyle just like theLabeldoes.It’s not readily apparent why your custom renderer is not working.