Grid Flex


    
    
        
            import mx.collections.Grouping;
            import mx.collections.GroupingField;
            import mx.collections.GroupingCollection2;
            [Bindable]
            private var groupingColl:GroupingCollection2;
            private function init():void {
                groupingColl = new GroupingCollection2();
                groupingColl.source = [{city:"A", state:"C",region:"E"}, 
                                       {city:"B",state:"D", region:"S"}];
                var groupingInst:Grouping = new Grouping();
                groupingInst.fields = [new GroupingField("state")];
                groupingColl.grouping = groupingInst;
                groupingColl.refresh(false);
                // create Column1 Grouping()
                groupingInst = new Grouping();
                groupingInst.fields = [new GroupingField("region")];
                groupingColl.grouping = groupingInst;
                groupingColl.refresh(false);
            }