0 Replies Latest reply on Jun 16, 2010 10:28 AM by adnan.m

    Combo box in datagrid

    adnan.m

      Hello,

       

      I have combobox in my datagrid, the combo box is as follow:

              <fx:Component id="inlineEditor">
                  <mx:ComboBox  >    
                      <mx:dataProvider>
                          <fx:String>MR. ONE</fx:String>
                          <fx:String>MR. TWO</fx:String>
                          <fx:String>MR. FOUR</fx:String>
                          <fx:String>MR. FIVE</fx:String>
                      </mx:dataProvider> 
                  </mx:ComboBox>
              </fx:Component> 
      

       

       

      And my datagrid is;

       

          <mx:DataGrid id="dataGrid"  editable="true" x="167" y="119"  creationComplete="dataGrid_creationCompleteHandler(event)" dataProvider="{getAllResult.lastResult}">
              <mx:columns>
                  <mx:DataGridColumn headerText="id" dataField="id" editable="false"/>
                  <mx:DataGridColumn headerText="name" dataField="name"/>
                  <mx:DataGridColumn headerText="surName" dataField="surName"
                                     itemEditor="{inlineEditor}" 
                                     editorDataField="selectedItem" />
                  <mx:DataGridColumn headerText="unitId" dataField="unitId"/>
                  <mx:DataGridColumn headerText="datum" dataField="datum"
                                     itemRenderer="mx.controls.DateField" 
                                     rendererIsEditor="true" 
                                     editorDataField="selectedDate"/> 
                  <mx:DataGridColumn headerText="company" dataField="company"
                                     itemRenderer="mx.controls.CheckBox"  
                                     rendererIsEditor="true" 
                                     editorDataField="selected"/>
              </mx:columns>
          </mx:DataGrid>
      

       

      Now this works fine with the values from the combobox. The issue here is that I need the combo box to be populated from a table/model, normaly I would use outside of the datagrid:

       

          <s:ComboBox x="138" y="399" id="comboBox" creationComplete="comboBox_creationCompleteHandler(event)" labelField="name">
              <s:AsyncListView list="{getAllResult2.lastResult}"/>
          </s:ComboBox>

       

      And this would work fine. But how to use this combobox in the datagrid. I use LCSD for DMS.

       

      All help is appriciated