2 Replies Latest reply on Aug 6, 2007 6:20 PM by Newsgroup_User

    two comboBox in a datagrid

    Level 7
      Hi All,
      When I create a new line in my grid I want to include two comboBox, the
      second comboBox related to the first one.
      I got it work partial, I can create the second combo on the fly but how can
      I insert the combo into the grid for specific row and column.
      The column is the same but the row change if I add one.
      Thanks

      JFB


        • 1. Re: two comboBox in a datagrid
          ntsiii Level 3
          This must be handled by your item renderer.

          Tracy
          • 2. Re: two comboBox in a datagrid
            Level 7
            Yes? but how in a dynamic form?
            This is what I'm doing... my setCategory function fill the array for the
            second comboBox but this only work for one row in my datagrid because if I
            set the second row in my datagrid and I change the option in my first
            comboBox it change the values for all second comboBox values.
            Now I can create a new comboBox on the fly but if I say comboBox.id =
            "materialItem_cb" it doesn show in the datagrid.
            How can I do this? Please help... I'm trying different things without luck
            Tks

            JFB

            public function setCategory(tempCombo:ComboBox):void{
            acMaterialsItem.removeAll();
            for each (var item:Object in acAllItems) {
            if (item.itemCategoryID == tempCombo.selectedItem.id) {
            acMaterialsItem.addItem(item);
            }
            }
            }


            <mx:DataGridColumn headerText="Category" dataField="itemCategoryID"
            editable="false" width="150">
            <mx:itemRenderer>
            <mx:Component>
            <mx:VBox>
            <mx:ComboBox id="category_cb"
            dataProvider="{outerDocument.acItemCategory}" labelField="label"
            change="outerDocument.setCategory(category_cb)" width="150"/>
            </mx:VBox>
            </mx:Component>
            </mx:itemRenderer>
            </mx:DataGridColumn>
            <mx:DataGridColumn headerText="Material Description"
            dataField="materialItemID" editable="false" width="200">
            <mx:itemRenderer>
            <mx:Component>
            <mx:VBox>
            <mx:ComboBox id="materialItem_cb"
            dataProvider="{outerDocument.acMaterialsItem}" labelField="label"
            width="200"/>
            </mx:VBox>
            </mx:Component>
            </mx:itemRenderer>
            </mx:DataGridColumn>

            "ntsiii" <tspratt@lariatinc.com> wrote in message
            news:f98ags$h40$1@forums.macromedia.com...
            > This must be handled by your item renderer.
            >
            > Tracy