3 Replies Latest reply on Oct 8, 2009 7:15 AM by rgadiparthi

    Select value in combobox (itemEditor)




      I've created an application with a combobox inside an itemEditor (datagridcolumn).


      I have two dataproviders. One with the data to be filled into the DataGrid, and one with the data to be filled into the ComboBox. How do I get the ComboBox to select the correct value on creation?


      I've searched to forum, but it refers to sites where the document is gone.


      <?xml version="1.0"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">    
                  import mx.collections.ArrayCollection;
                  private var inDataGrid:ArrayCollection = new ArrayCollection([
                      {account:13, sumD:0, sumK:15},
                      {account:2, sumD:0, sumK:15},
                      {account:12, sumD:30, sumK:0}     
                  public var inComboBox:ArrayCollection = new ArrayCollection([
                      {label: "1510 - Kundfordringar", id:14},
                      {label: "1910 - Kassa", id:13},
                      {label: "1920 - Bank", id:2},
                      {label: "2040 - Lev.fordringar", id:12}     
          <mx:DataGrid id="myGrid" dataProvider="{inDataGrid}" 
                  <mx:DataGridColumn dataField="label" headerText="Konto">
                                 <!-- What to do here? -->
                                 <mx:ComboBox dataProvider="{outerDocument.inComboBox}" 
                                      labelField="label" />
              </mx:columns >


      I'm looking forward to an answer,