Apache – how to show data at group level in flex advanced grid


I am working on a grid example in flex using advanced grid control.
I know we can easily group data by specifying the field name.

At the group node level, other than the gorup name I want to be able to show data in the rest of the cells ( calculated data ) and I am looking for some dataRowBound event or similar to be able to hook some data in it.

Example: Grid displaying list of towns grouped by state. At the group level ( for each state) I want to show the total number of towns in each state. Here how can i show the total number in the town column.

Best Solution

You can do this by providing the data like this

<trade TrdId="Trade 1 o" col="0xCC9999" cmenu="YNYNYNYNYNYNYNY" AgreementId="1234">        
 <trade TrdId="Trade 1.1" col="0xCC9999" cmenu="YNYNYNYNYNYNYNY" AgreementId="1234">                 
 <trade TrdId="Trade 1.2"col="0xCC9999" cmenu="YYYYYYYYNYNYYYY" AgreementId="1234">              

And adding columns which read this data like


so on...

protected override function drawRowBackground(s:Sprite, rowIndex:int, y:Number, height:Number, color:uint, dataIndex:int):void{
              var XMLdata:XML=rowNumberToData(dataIndex) as XML;

                        if(XMLdata.attribute(Constants.col) != undefined && XMLdata.attribute(Constants.col) != ""){

this is best method to get data out of grid and do some processing...

Related Question