1 Reply Latest reply on Aug 24, 2007 12:13 AM by P Steven

    Display item renderer in only some rows of a datagrid

    P Steven Level 1
      I need to display a combobox item renderer in my datagrid only in the first of every 5 rows. With the remaining 4 rows in this particular column empty. Then the pattern will repeat again.

      This is how I am currently creating the columns however with this approach the combobox itemrenderer is appearing in all rows

      <mx:columns>
      <mx:DataGridColumn headerText="No." dataField="assCriteriaNum" width="60" />
      <mx:DataGridColumn headerText="Assessment Criteria" dataField="assCriteria" width="210"/>
      <mx:DataGridColumn headerText="Mark Range" dataField="markRange" width="50" />
      <mx:DataGridColumn headerText="Mark" dataField="mark" width="70" >
      <mx:itemRenderer>
      <mx:Component>
      <mx:ComboBox>
      <mx:dataProvider>
      <mx:ArrayCollection>
      <mx:String>0</mx:String>
      <mx:String>1</mx:String>
      <mx:String>2</mx:String>
      <mx:String>3</mx:String>
      <mx:String>4</mx:String>
      <mx:String>5</mx:String>
      <mx:String>6</mx:String>
      <mx:String>7</mx:String>
      <mx:String>8</mx:String>
      <mx:String>9</mx:String>
      <mx:String>10</mx:String>
      </mx:ArrayCollection>
      </mx:dataProvider>
      </mx:ComboBox>

      </mx:Component>
      </mx:itemRenderer>
      </mx:DataGridColumn>

      </mx:columns>
        • 1. Re: Display item renderer in only some rows of a datagrid
          P Steven Level 1
          Here is my data provider hard coded

          <mx:dataProvider>
          <mx:ArrayCollection>
          <mx:Array>
          <mx:Object assCriteria="A01 Manage." />
          <mx:Object assCriteriaNum="1" assCriteria="Brief project plan, with little evidence of monitoring progress of project work against the project plan." markRange="(1-3)" />
          <mx:Object assCriteriaNum="2" assCriteria="Limited identification of the topic to be investigated/ researched and limited evidence of appropriate aims and objectives, and proposed project title." markRange="(1-3)" />
          <mx:Object assCriteriaNum="3" assCriteria="Project plan, with some evidence of monitoring progress of project work against the project plan." markRange="(4-6)" />
          <mx:Object assCriteriaNum="4" assCriteria="Some identification of the topic to be investigated/ researched and some evidence of appropriate aims complete the work and objectives, and proposed project title." markRange="(4-6)" />
          <mx:Object assCriteriaNum="5" assCriteria="Detailed project plan, with clear evidence of monitoring progress of project work against the project plan." markRange="(7-10)" />
          <mx:Object assCriteriaNum="6" assCriteria="Clear identification of the topic to be investigated/ researched and clear evidence of appropriate aims identify the topic and objectives, and proposed project title." markRange="(7-10)" />
          <mx:Object assCriteriaNum="7" assCriteria="No relevant response." markRange="(0)" />

          <mx:Object assCriteria="A02 Use resources/research." />
          <mx:Object assCriteriaNum="8" assCriteria="Little or no analysis and application of the research, with few links made to appropriate theories and concepts." markRange="(1-5)" />
          <mx:Object assCriteriaNum="9" assCriteria="Evidence of limited research involving limited selection and evaluation of sources." markRange="(1-5)" />
          <mx:Object assCriteriaNum="10" assCriteria="Some analysis and application of the research, with links made to appropriate theories and concepts." markRange="(4-6)" />
          <mx:Object assCriteriaNum="11" assCriteria="Evidence of some research involving the selection analyse data and evaluation of a range of relevant sources." markRange="(4-6)" />
          <mx:Object assCriteriaNum="12" assCriteria="Critical analysis and application of the research, with obtain and select clear links made to appropriate theories and information from a concepts. variety of sources." markRange="(7-10)" />
          <mx:Object assCriteriaNum="13" assCriteria="Evidence of detailed research involving the selection and evaluation of a wide range of relevant sources." markRange="(7-10)" />
          <mx:Object assCriteriaNum="14" assCriteria="No relevant response." markRange="(0)" />

          </mx:Array>
          </mx:ArrayCollection>
          </mx:dataProvider>