<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
public var datas:ArrayCollection = new ArrayCollection([1,2,3,4]);
private var gridDatas:ArrayCollection = new ArrayCollection([
{col1:1,col2:2,col3:3},
{col1:1,col2:2,col3:3},
{col1:1,col2:2,col3:3}
]);
]]>
</mx:Script>
<mx:DataGrid x="89" y="111" width="350" height="145" dataProvider="{gridDatas}">
<mx:columns>
<mx:DataGridColumn headerText="Column 1" dataField="col1"/>
<mx:DataGridColumn headerText="Column 2" dataField="col2"/>
<mx:DataGridColumn headerText="Column 3" dataField="col3">
<mx:itemRenderer>
<mx:Component>
<mx:ComboBox dataProvider="{outerDocument.datas}"/>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
</mx:Application>
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/xuhuanchao/archive/2009/10/30/4749235.aspx