4 Replies Latest reply on Sep 10, 2010 10:06 AM by jzabroski

    Matrix of Radio buttons on Datagrid please help!

    jd_ice Level 1

      Hi,

       

          Anyone help me walk through this, I have a Datagrid object which uses radio button as item renderer.

      To be more specific this is a matrix of radio buttons on datagrid. The datagid columns are dynamically generated depending on the number of items i have in my database record, (e.g could be 10, 20, and so on...). The rendering of items goes well. Now my question would be how am I able to group the radio button in my datagrid "per column or per row"? since it appears to me that groupName is not working if applied on the item renderer. I also set the a radio button group on the item renderer parent document but it sets all the button to only one group.

       

      Any hints, and ideas how am I able to accomplish this? Please help this novice trying to wrap himself in flex.

       

      Thanks!

       

      Best Regards

        • 1. Re: Matrix of Radio buttons on Datagrid please help!
          Subeesh Arakkan Level 4

          try this.

          <mx:RadioButtonGroup id="groupA"/>
          <mx:RadioButtonGroup id="groupB"/>
          
          <mx:DataGrid>
               <mx:dataProvider>
                    <mx:Object Group="A" Price="11.99" groupName="groupA"/>
                    <mx:Object Group="B" Price="11.99"  groupName="groupB"/>
                    <mx:Object Group="A" Price="11.99" groupName="groupA"/>
                    <mx:Object Group="B" Price="11.99"  groupName="groupB"/>
                    <mx:Object Group="A" Price="11.99" groupName="groupA"/>
                    <mx:Object Group="B" Price="11.99"  groupName="groupB"/>
                    <mx:Object Group="A" Price="11.99" groupName="groupA"/>
                    <mx:Object Group="B" Price="11.99"  groupName="groupB"/>
               </mx:dataProvider>
               <mx:columns>
                    <mx:DataGridColumn dataField="Group">
                         <mx:itemRenderer>
                              <mx:Component>
                                   <mx:RadioButton groupName="{data.groupName}" label="{data.Group}"/>
                              </mx:Component>
                         </mx:itemRenderer>
                    </mx:DataGridColumn>
                    <mx:DataGridColumn dataField="Price"/>
               </mx:columns>
          </mx:DataGrid>
          

           

           

          You may want to set the groupName dynamically in your data provider.

          • 2. Re: Matrix of Radio buttons on Datagrid please help!
            jd_ice Level 1

            Yeah, I get that.... but its not what I want... its not a just static grouping, its more like a preferences whether the groupings of the radio buttons has to be in rows["horizontally"] or in columns ["vertically"]. As I've said this is a matrix of radio buttons.

             

            example 10 columns of radio button.

            • 3. Re: Matrix of Radio buttons on Datagrid please help!
              jd_ice Level 1

              anyone have the idea? please help

              • 4. Re: Matrix of Radio buttons on Datagrid please help!
                jzabroski

                Could you give a visual example of what you want to achieve?

                 

                I am not sure I can help you without knowing how you want it to work.