Populating a Datagrid with variable number of columns and rows in Flex

Posted by Rie Mino on Stack Overflow See other posts from Stack Overflow or by Rie Mino
Published on 2010-05-17T23:24:37Z Indexed on 2010/05/17 23:30 UTC
Read the original article Hit count: 235

I am trying to figure out how to manage a Datagrid based on an XML object like this:

<matrix rows="5" columns="5">
<column>
    <row>0.5</row>
    <row>0.21</row>
</column>
<column>
    <row>0.6</row>
    <row>0.9</row>
</column>
<column>
    <row>0.5</row>
    <row>0.5</row>
</column>
<column>
    <row>0.8</row>
    <row>0.4</row>
</column>
</matrix>

I will need to populate the Datagrid column names based on a different XML object and use the above XML to populate each of the column's rows. I currently am able to create the Datagrid and populate its column headers but I am unsure as to how to how to add the rows for each column. The above XML will be update with new row and column elements added and deleted. This, of course, will be bound to the Datagrid to show updates.

Thanks in advanced for your help.

© Stack Overflow or respective owner

Related posts about flex

Related posts about actionscript-3