1 Reply Latest reply on Jun 21, 2007 4:24 AM by Leoš

    Item render problem

    rajeeva_nagaraj
      Hi all,
      How can I put a comboBox inside a datagrid?
      I want to set the comboBox with their own dataprovider and the id should
      pass to the datagrid fill at the save time.
      I try this but doesnt let me to include a dataprovider.
      Any links??
      please help and thank you in advance.

      <mx:DataGridColumn headerText="Status" dataField="Status" >
      <mx:itemRenderer>
      <mx:Component>
      <mx:VBox>
      <mx:ComboBox id="{arrStatus}"></mx:ComboBox>
      </mx:VBox>
      </mx:Component>
      </mx:itemRenderer>
      </mx:DataGridColumn>

      arrStatus is an array which will have a collection of different status
        • 1. Re: Item render problem
          Leoš Level 1
          Hi,
          try:
          <mx:DataGridColumn>
          <mx:itemRenderer>
          <mx:Component>
          <mx:ComboBox>
          <mx:dataProvider>
          <mx:Array>
          <mx:Object label="label 1"/>
          <mx:Object label="label 2"/>
          <mx:Object label="label 3"/>
          <mx:Object label="label 4"/>
          </mx:Array>
          </mx:dataProvider>
          </mx:ComboBox>
          </mx:Component>
          </mx:itemRenderer>
          </mx:DataGridColumn>


          or second way is (but I dont advice you):
          arrStatus have to be defined in mxml component, where is your DataGrid.


          <mx:DataGridColumn>
          <mx:itemRenderer>
          <mx:Component>
          <mx:ComboBox dataProvider="{owner['parent'].arrStatus}"/>
          </mx:Component>
          </mx:itemRenderer>
          </mx:DataGridColumn>