views:

67

answers:

2

Hi,

i've got an ArrayCollection which is properly displayed in this Advanced Datagrid:

 <mx:AdvancedDataGrid id="drawingDataDG"
 editable="true" sortableColumns="true"
 headerWordWrap="true"
 sortExpertMode="true"
 rowCount="8" y="10" right="10" left="10"
  dataProvider="{model.drawingsData}">   
    <mx:columns>
         <mx:AdvancedDataGridColumn 
      headerText="Approved in Week" 
      dataField="ApprovedInWeek" 
      editable="false"
      visible="true"  />
     <mx:AdvancedDataGridColumn 
      headerText="DRAWING_PK" 
      dataField="DRAWING_PK" 
      editable="false"
      visible="false"  />
     <mx:AdvancedDataGridColumn 
      headerText="Drawing No" 
      dataField="DRAWING_NO" 
      editable="false"
      visible="true"/>
     <mx:AdvancedDataGridColumn 
      headerText="Drawing Index" 
      dataField="DRAWING_INDEX" 
      editable="false"
      visible="true"/>
   </mx:columns>

`

According to this explanation link text I've implemented a GroupingCollection. But it just don't work???

<mx:AdvancedDataGrid id="drawingDataDG" editable="true" sortableColumns="true" headerWordWrap="true" sortExpertMode="true" rowCount="8" y="10" right="10" left="10" initialize="gc.refresh();">
<mx:dataProvider> <mx:GroupingCollection id="gc" source="{model.drawingsData}"> <mx:Grouping> <mx:GroupingField name="ApprovedInWeek"/> </mx:Grouping> </mx:GroupingCollection> </mx:dataProvider>
<mx:columns> <mx:AdvancedDataGridColumn headerText="Approved in Week" dataField="ApprovedInWeek" editable="false" visible="true" /> <mx:AdvancedDataGridColumn headerText="DRAWING_PK" dataField="DRAWING_PK" editable="false" visible="false" /> <mx:AdvancedDataGridColumn headerText="Drawing No" dataField="DRAWING_NO" editable="false" visible="true"/> <mx:AdvancedDataGridColumn headerText="Drawing Index" dataField="DRAWING_INDEX" editable="false" visible="true"/> </mx:columns> </mx:AdvancedDataGrid>

Please let me know what additional details you may need?

Werner

+1  A: 

You have to pass the AdvancedDataGrid an instance of the HierarchicalData class as its dataProvider in order for it to recognize your GroupingCollections

Robusto
A: 

Finally I was able to implement grouping according to this blog: Summarizing Grouped Data With Flex 3 AdvancedDataGrid Thanks Robusto for guiding!

Werner