2 Replies Latest reply on Dec 9, 2009 1:55 AM by Pii T

    Displaying properties from two objects in a datagrid

    Pii T

      Previously I post a discussion on this matter on Flex learning path and haven't got any response on how to do this so I figured that I might as well try again here.

       

      I'm using drag and drop binding in flash builder 4 on a data-grid. However, the data I need to show need to be query from another object.

       

      <mx:DataGrid id="dataGrid2" dataProvider="{getMajorDetailsResult.lastResult}">
                  <mx:columns>
                      <mx:DataGridColumn headerText="Category Name" />
                      <mx:DataGridColumn headerText="Require Credits" dataField="requireCredits" resizable="false" width="40"/>
                  </mx:columns>
      </mx:DataGrid>
      

       

      In this datagrid I bind it with an object MACL which has

       

      - ID

      - CAT_ID

      - requireCredits

       

      However, I would like to display CategoryName in the first column but categoryName is in another Object (category)

       

      - CAT_ID

      - CategoryName

       

      In this case what should I do?

       

      I did this so that if in the future Category Name needs to be rename. I can just rename the one in category table.

       

      Any help is highly appreciated.

       

      Thank you