views:

13

answers:

0

I am going crazy trying to get a combobox value inside a datagrid by pressing a button external to the datagrid. here is the code:

mxml

left="243" top="0" title="Voting" hideEffect="{fadeOut}" showEffect="{fadeIn}" > showHeaders="false" dataProvider="{MCArray}" variableRowHeight="true" selectable="false" wordWrap="true" borderStyle="none" alternatingItemColors="[#FFFFFF, #FFFFFF]" >

                                </mx:VBox>
                            </mx:Component>
                        </mx:itemRenderer>
                    </mx:DataGridColumn>                    
                </mx:columns>
            </mx:DataGrid>
            <mx:Button label="Confirm" id="btnMC" bottom="3" horizontalCenter="2" click="radioSel()"/>
        </mx:Panel>

.as

    [Bindable]
    private var MCArray:ArrayCollection;

    private function resultHandler8(evt:ResultEvent):void{
        MCArray = evt.result.MCs.MC;
    }
    private function faultHandler8(evt:FaultEvent):void{
        mx.controls.Alert.show("Server connection not available")
    }

    private function radioSel():void{
        for each( var item:Object in dgMC.dataProvider )
        {

//this is the point where I should capture the combobox value of each datagrid row
mx.controls.Alert.show(item.cbMC.labelField) } }

Thanks