开发者

Text align in datagrid

开发者 https://www.devze.com 2023-03-12 04:23 出处:网络
How to place two different texts( using html tags ) incolumn in a datagrid , in which one will be right aligned and the other will be left aligned.开发者_StackOverflow社区Create a custom itemRenderer

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>
0

精彩评论

暂无评论...
验证码 换一张
取 消