爲DataGrid提供一個ComboBox類型的ItemRenderer,以下圖:ide
可是在點擊ComboBox的時候取不到DataGrid當前的selectedIndex,不能實現須要的功能。spa
利用下面代碼可取得當前項在DataGrid的dataProvider中的索引。xml
var itemIndex:int = ArrayCollection((owner as DataGrid).dataProvider).getItemIndex(_ownerData);