4 Replies Latest reply on Mar 6, 2008 1:28 AM by Nutan.lade

    DataGrid Problem

    Nutan.lade Level 1
      I want to put a datagrid in my application so that the header fields represent test names like unitest1,unittest2 and so on.And the first row showing subjects like english,hindi and so on.And all other rows shows marks for respective subjects.So please how to represent XMLList or any other dataprovider to solve these issue.Here is the piece of code I used.
      <mx:XMLList xmlns="" id="marks">
      <unit>
      <subject>English</subject>
      <unit1>24</unit1>
      <hindi>23</hindi>
      <telugu>23</telugu>
      <maths>25</maths>
      <science>20</science>
      <social>22</social>
      <gk>23</gk>
      <comp>22</comp>
      <total>140</total>
      </unit>
      <unit>
      <subject>Hindi</subject>
      <unit1>22</unit1>
      <hindi>24</hindi>
      <telugu>23</telugu>
      <maths>24</maths>
      <science>22</science>
      <social>23</social>
      <gk>23</gk>
      <comp>22</comp>
      <total>140</total>
      </unit>
      <unit>
      <subject>Telugu</subject>
      <unit1>23</unit1>
      <hindi>24</hindi>
      <telugu>16</telugu>
      <maths>22</maths>
      <science>18</science>
      <social>17</social>
      <gk>23</gk>
      <comp>22</comp>
      <total>140</total>
      </unit>
      <unit>
      <subject>Maths</subject>
      <unit1>24</unit1>
      <hindi>17</hindi>
      <telugu>16</telugu>
      <maths>20</maths>
      <science>22</science>
      <social>22</social>
      <gk>23</gk>
      <comp>22</comp>
      <total>140</total>
      </unit>
      <unit>
      <subject>Science</subject>
      <unit1>24</unit1>
      <hindi>23</hindi>
      <telugu>23</telugu>
      <maths>25</maths>
      <science>20</science>
      <social>22</social>
      <gk>23</gk>
      <comp>22</comp>
      <total>140</total>
      </unit>
      <unit>
      <subject>Social</subject>
      <unit1>24</unit1>
      <hindi>23</hindi>
      <telugu>23</telugu>
      <maths>25</maths>
      <science>20</science>
      <social>22</social>
      <gk>23</gk>
      <comp>22</comp>
      <total>140</total>
      </unit>
      <unit>
      <subject>G.K</subject>
      <unit1>24</unit1>
      <hindi>23</hindi>
      <telugu>23</telugu>
      <maths>25</maths>
      <science>20</science>
      <social>22</social>
      <gk>23</gk>
      <comp>22</comp>
      <total>140</total>
      </unit>
      <unit>
      <subject>Computers</subject>
      <unit1>24</unit1>
      <hindi>23</hindi>
      <telugu>23</telugu>
      <maths>25</maths>
      <science>20</science>
      <social>22</social>
      <gk>23</gk>
      <comp>22</comp>
      <total>140</total>
      </unit>
      <unit>
      <subject>Total</subject>
      <unit1>24</unit1>
      <hindi>23</hindi>
      <telugu>23</telugu>
      <maths>25</maths>
      <science>20</science>
      <social>22</social>
      <gk>23</gk>
      <comp>22</comp>
      <total>140</total>
      </unit>

      </mx:XMLList>
      <mx:DataGrid x="6" y="56" dataProvider="{marks}" height="230">
      <mx:columns>
      <mx:DataGridColumn headerText="Subjects" dataField="subject"/>
      <mx:DataGridColumn headerText="UnitTest1" dataField="unit1"/>
      <mx:DataGridColumn headerText="UnitTest2" dataField="hindi"/>
      <mx:DataGridColumn headerText="Quarterly" dataField="telugu"/>
      <mx:DataGridColumn headerText="UnitTest3" dataField="maths"/>
      <mx:DataGridColumn headerText="HalfYearly" dataField="science"/>
      <mx:DataGridColumn headerText="UnitTest4" dataField="social"/>
      <mx:DataGridColumn headerText="Final" dataField="gk"/>
      </mx:columns>
      </mx:DataGrid>

      but they are providing the dat as i needed.please solve this problem as soon as possible.Thanq in advance.