Nancy
Nancy

Reputation: 15

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.

Upvotes: 1

Views: 1137

Answers (2)

Jason Towne
Jason Towne

Reputation: 8050

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>

Upvotes: 0

JeffryHouser
JeffryHouser

Reputation: 39408

Create a custom itemRenderer for the column in question. Here is an article on itemRenderers.

Upvotes: 1

Related Questions