Link to home
Start Free TrialLog in
Avatar of CCBRONET
CCBRONET

asked on

ComboBox ItemRenderer inside Datagrid

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 on clicking Submit.The datagrid has many columns and user has to select one value for each row.How to find out the selected value of the combo-box??


Here is my code:

<mx:DataGrid id="namesgrid" width="834" height="354" dataProvider="{List}"
                  resizableColumns="true" draggableColumns="true"
                  doubleClick="onGridClick()" doubleClickEnabled="true" x="0" y="0">
                  <mx:columns>
                        <mx:DataGridColumn id="bid" headerText="BName" dataField="branchdesc" width="100"/>
                        <mx:DataGridColumn id="poid" headerText="P-ID" dataField="proddesc" width="100"/>
                        <mx:DataGridColumn id="acid" headerText="No" dataField="accountno" width="80"/>
                        <mx:DataGridColumn id="nac" headerText="Name" dataField="mainpersonname" width="275"/>
                        <mx:DataGridColumn id="art" headerText="Type" dataField="recordtype" width="200"/>      
                <mx:DataGridColumn id="cmbtaskstatus" headerText="Status Change *" width="200"
                       editable="true" editorDataField="value">
                      <mx:itemRenderer>
                            <mx:Component>
                                  <mx:ComboBox color="#000000">
                                        <mx:dataProvider>
                                              <mx:String>FW</mx:String>
                                              <mx:String>AW</mx:String>
                                              <mx:String>CA</mx:String>
                                              <mx:String>OA</mx:String>
                                              <mx:String>RE</mx:String>                                              
                                        </mx:dataProvider>
                                  </mx:ComboBox>
                            </mx:Component>
                      </mx:itemRenderer>
                </mx:DataGridColumn>
   </mx:columns>
</mx:DataGrid>
ASKER CERTIFIED SOLUTION
Avatar of zzynx
zzynx
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You have to trap the click or change event for the  itemrenderer (combobox)

change="Alert('You selected ' + data.selected); trace(data.selected);"