Alessandro Baldoni
Alessandro Baldoni

Reputation: 132

FLEX datagrid and XML list content

I have the following XML list:

<Queries>
    <Query id="1">qq</Query>
    <Query id="2">rr</Query>
    <Query id="3">ss</Query>
</Queries>

and I would like to display it in the following datagrid:

<mx:DataGrid id="dataGrid" dataProvider="@{Queries.Query}" editable="true" width="500">
    <mx:columns>
         <mx:DataGridColumn headerText="id" dataField="@id" resizable="false" width="100"/>
         <mx:DataGridColumn headerText="Query" dataField="Query"/>
    </mx:columns>
</mx:DataGrid>

The 'id' column is correctly populated but the 'Query' column is empty. How can I solve this?

Upvotes: 3

Views: 1225

Answers (1)

Ravish
Ravish

Reputation: 2447

Try this.

<mx:DataGrid id="dataGrid" dataProvider="{Queries.Query}" editable="true" width="500">
<mx:columns>
     <mx:DataGridColumn headerText="id" dataField="@id" resizable="false" width="100"/>
     <mx:DataGridColumn headerText="Query" dataField="*"/>
</mx:columns>

Regards, Ravish.

Upvotes: 1

Related Questions