How to get the value of a ComboBox within a DataGrid

Posted by Jason Towne on Stack Overflow See other posts from Stack Overflow or by Jason Towne
Published on 2010-05-12T22:28:27Z Indexed on 2010/05/12 22:34 UTC
Read the original article Hit count: 198

Filed under:
|
|

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>

© Stack Overflow or respective owner

Related posts about flex

Related posts about datagrid