### test.mxml
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" >
<mx:Model id="someData" source="some.xml"/>
    <mx:DataGrid dataProvider="{someData.item}">
                <mx:columns>
                <mx:Array>
                    <mx:DataGridColumn dataField="code" headerText="Code"/>               
                    <mx:DataGridColumn dataField="desc" headerText="Desc"/>
                    <mx:DataGridColumn dataField="price" headerText="Price"/>
                </mx:Array>
            </mx:columns>
    </mx:DataGrid>
</mx:Application>

### some.xml
<?xml version="1.0"?>
<items>
    <item>
        <code>34214</code>
        <desc>foo</desc>
        <price>23</price>
    </item>
    <item>
        <code>42234</code>
        <desc>bar</desc>
        <price>56</price>
    </item>   
</items>


Silpa sirivella wrote:

How can populate data dynamically in data grid??
For ex: i have a XML data, i've to read through <items>

<items>
<itemcode>34214</itemcode>
<itemdesc>something</itemdesc>
<itemprice>$23</itemprice>
</items>
.... and more items

i want put all these elements in a array and bind to a DataGrid. Is
Dynamic datagrid possible??


__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to