注意:遍歷數據主要是依靠提供的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>