注意:遍历数据主要是依靠提供的dataProvider属性
<!-- 测试数据 -->
<mx:XMLList id="employees">
<employee>
<name>Christina Coenraets</name>
<phone>555-219-2270</phone>
</employee>
<employee>
<name>Joanne Wall</name>
<phone>555-219-2012</phone>
</employee>
<employee>
<name>Maurice Smith</name>
<phone>555-219-2012</phone>
</employee>
<employee>
<name>Mary Jones</name>
<phone>555-219-2000</phone>
</employee>
</mx:XMLList>
<mx:DataGrid x="2.6" y="1" width="98%" height="98%" dataProvider="{employees}" editable="true" borderStyle="none" >
<mx:columns>
<mx:DataGridColumn headerText="属性名称" dataField="name" editable="false"/>
<mx:DataGridColumn headerText="属性值" dataField="phone" editable="true"/>
</mx:columns>
</mx:DataGrid>