How to get the value of a ComboBox within a DataGrid
- by Jason Towne
While this may be a simple problem, I'm having a heck of a time coming up with a solution.
I have a DataGrid with a ComboBox as an ItemRenderer for one of my columns. When the user selects a row, I want to get the ComboBox's selected value for the selected row.
Any suggestions?
Some sample code:
<mx:DataGrid id="myGrid"
dataProvider="{myData}">
<mx:columns>
<mx:DataGridColumn headerText="Column 1" dataField="dataField1" />
<mx:DataGridColumn headerText="Column 2" dataField="dataField2_Array">
<mx:itemRenderer>
<mx:Component>
<mx:HBox paddingLeft="5">
<mx:ComboBox id="myComboBox" dataProvider="{data.dataField2_Array}" />
</mx:HBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>