AdvancedDataGridColumn for the GroupLabel field : AdvancedDataGridColumn « Grid « Flex






AdvancedDataGridColumn for the GroupLabel field

AdvancedDataGridColumn for the GroupLabel field
  

<?xml version="1.0"?>
<!--
Code from Flex 4 Documentation "Using Adobe Flex 4".

This user guide is licensed for use under the terms of the Creative Commons Attribution 
Non-Commercial 3.0 License. 

This License allows users to copy, distribute, and transmit the user guide for noncommercial 
purposes only so long as 
  (1) proper attribution to Adobe is given as the owner of the user guide; and 
  (2) any reuse or distribution of the user guide contains a notice that use of the user guide is governed by these terms. 
The best way to provide notice is to include the following link. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/

-->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        
        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}
        ]); 
      
    </mx:Script>
    <mx:AdvancedDataGrid id="myADG" width="100%"
        height="100%" defaultLeafIcon="{null}" initialize="gc.refresh();">
        <mx:dataProvider>
            <mx:GroupingCollection2 id="gc" source="{dpFlat}">
                <mx:Grouping>
                    <mx:GroupingField name="Column1" />
                    <mx:GroupingField name="Territory" />
                </mx:Grouping>
            </mx:GroupingCollection2>
        </mx:dataProvider>
        <mx:columns>
            <mx:AdvancedDataGridColumn dataField="GroupLabel" headerText="Column1/Territory" />
            <mx:AdvancedDataGridColumn dataField="Column2" headerText="Territory Rep" />
            <mx:AdvancedDataGridColumn dataField="Value1" />
            <mx:AdvancedDataGridColumn dataField="Value2" />
        </mx:columns>
    </mx:AdvancedDataGrid>
</mx:Application>

   
    
  








Related examples in the same category

1.Add multiple groups to the controlAdd multiple groups to the control
2.AdvancedDataGridColumn inside ColumnsAdvancedDataGridColumn inside Columns
3.Set default leaf icon to null to hide itSet default leaf icon to null to hide it
4.Custom icons for the folder open and closed iconsCustom icons for the folder open and closed icons
5.Use groupedColumns component to group columns togetherUse groupedColumns component to group columns together
6.Create the column groupingCreate the column grouping
7.Multiple column sort when the sortExpertMode property is set to trueMultiple column sort when the sortExpertMode property is set to true
8.Add groups named Area and RevenuesAdd groups named Area and Revenues
9.Column Grouping for Hierarchical DataColumn Grouping for Hierarchical Data
10.Regroup GroupCollectionRegroup GroupCollection