Text align in datagrid
How to place two different texts( using html tags ) in column in a datagrid , in which one will be right aligned and the other will be left aligned.开发者_StackOverflow社区
Create a custom itemRenderer for the column in question. Here is an article on itemRenderers.
To go along with Flextras answer, here's a quick example:
<mx:DataGrid dataProvider="{myArrayCollection}">
<mx:columns>
<mx:DataGridColumn headerText="Title" dataField="title">
<mx:itemRenderer>
<mx:Component>
<mx:VBox paddingLeft="2" width="100%">
<mx:Label text="{myDataField1}" width="100%" />
<mx:Label text="{myDataField2}" textAlign="right" width="100%" />
</mx:VBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
精彩评论