Grid Flex





    
        
        import mx.collections.GroupingField;
        import mx.collections.Grouping;
        import mx.collections.GroupingCollection2;
        import mx.collections.ArrayCollection;
        [Bindable]
        private var dpFlat:ArrayCollection = new ArrayCollection([
            {Column1:"Southwest", Territory:"Arizona",Column2:"Barbara Jennings", Value1:38865, Value2:40000},
            {Column1:"Southwest", Territory:"Arizona",Column2:"Dana Binn", Value1:29885, Value2:30000},
            {Column1:"Southwest", Territory:"Central California",Column2:"Joe Smith", Value1:29134, Value2:30000},
            {Column1:"Southwest", Territory:"Nevada",Column2:"Bethany Pittman", Value1:52888, Value2:45000},
            {Column1:"Southwest", Territory:"Northern California",Column2:"Lauren Ipsum", Value1:38805, Value2:40000},
            {Column1:"Southwest", Territory:"Northern California",Column2:"T.R. Smith", Value1:55498, Value2:40000},
            {Column1:"Southwest", Territory:"Southern California",Column2:"Alice Treu", Value1:44985, Value2:45000},
            {Column1:"Southwest", Territory:"Southern California",Column2:"Jane Grove", Value1:44913, Value2:45000}
        ]); 
        [Bindable]
        public var myGColl:GroupingCollection2 = new GroupingCollection2();
        private var myGrp:Grouping = new Grouping();
        private function initDG():void {
            myGColl.source = dpFlat;
            myGrp.fields = [new GroupingField("Column1"), new GroupingField("Territory")];
            myGColl.grouping = myGrp;
            myADG.dataProvider=myGColl;
            myGColl.refresh();
        }
      
    

            height="100%" creationComplete="initDG();">
        
            
            
                            headerText="Territory Rep" />