Group AdvancedDataGrid with MXML Default Properties : AdvancedDataGrid « Grid « Flex






Group AdvancedDataGrid with MXML Default Properties

Group AdvancedDataGrid with MXML Default Properties
      

<!--
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/

-->



    <!-- dpcontrols/adg/SimpleGroupADGMXMLDefaultProp.mxml -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark">
    <fx:Script> 
         
        import mx.collections.ArrayCollection; 
        [Bindable] 
        private var dpFlat:ArrayCollection = new ArrayCollection([ 
            {Region:"Southwest", Territory:"Arizona",Territory_Rep:"Barbara Jennings", Actual:38865, Estimate:40000}, 
            {Region:"Southwest", Territory:"Arizona",Territory_Rep:"Dana Binn", Actual:29885, Estimate:30000}, 
            {Region:"Southwest", Territory:"Central California",Territory_Rep:"Joe Smith", Actual:29134, Estimate:30000}, 
            {Region:"Southwest", Territory:"Nevada", Territory_Rep:"Bethany Pittman", Actual:52888, Estimate:45000}, 
            {Region:"Southwest", Territory:"Northern California",Territory_Rep:"Lauren Ipsum", Actual:38805, Estimate:40000}, 
            {Region:"Southwest", Territory:"Northern California",Territory_Rep:"T.R. Smith", Actual:55498, Estimate:40000}, 
            {Region:"Southwest", Territory:"Southern California",Territory_Rep:"Alice Treu", Actual:44985, Estimate:45000}, 
            {Region:"Southwest", Territory:"Southern California",Territory_Rep:"Jane Grove", Actual:44913, Estimate:45000} 
            ]); 
      
    </fx:Script>
    <mx:AdvancedDataGrid id="myADG" width="100%"
        height="100%" initialize="gc.refresh();">
        <mx:dataProvider>
            <mx:GroupingCollection2 id="gc" source="{dpFlat}">
                <mx:Grouping label="Region">
                    <mx:GroupingField name="Region" />
                    <mx:GroupingField name="Territory" />
                </mx:Grouping>
            </mx:GroupingCollection2>
        </mx:dataProvider>
        <mx:columns>
            <mx:AdvancedDataGridColumn dataField="Region" />
            <mx:AdvancedDataGridColumn dataField="Territory" />
            <mx:AdvancedDataGridColumn dataField="Territory_Rep"
                headerText="Territory Rep" />
            <mx:AdvancedDataGridColumn dataField="Actual" />
            <mx:AdvancedDataGridColumn dataField="Estimate" />
        </mx:columns>
    </mx:AdvancedDataGrid>
</s:Application>

   
    
    
    
    
    
  








Related examples in the same category

1.Use HierarchicalData.childrenField to specify the name of the field that defines the hierarchyUse HierarchicalData.childrenField to specify the name of the field that defines the hierarchy
2.Hierarchical AdvancedDataGrid TreeColumnHierarchical AdvancedDataGrid TreeColumn
3.AdvancedDataGrid with four columnsAdvancedDataGrid with four columns
4.Using AdvancedDataGrid to show hierarchical dataUsing AdvancedDataGrid to show hierarchical data
5.Setting up the AdvancedDataGrid with dataField and headerTextSetting up the AdvancedDataGrid with dataField and headerText
6.AdvancedDataGrid and column groupingAdvancedDataGrid and column grouping
7.ArrayCollection and AdvancedDataGridArrayCollection and AdvancedDataGrid
8.Call invalidateList to refresh and apply the style to the AdvancedDataGridCall invalidateList to refresh and apply the style to the AdvancedDataGrid
9.Use styleFunction to apply style to AdvancedDataGrid based on conditionsUse styleFunction to apply style to AdvancedDataGrid based on conditions
10.Cut and paste cell for AdvancedDataGrid the TextArea control located at the bottom of the application:Cut and paste cell for AdvancedDataGrid the TextArea control located at the bottom of the application:
11.Allow Multiple Selection for AdvancedDataGridAllow Multiple Selection for AdvancedDataGrid
12.AdvancedDataGrid with With Hierarchical DataAdvancedDataGrid with With Hierarchical Data
13.AdvancedDataGrid with SummaryFieldAdvancedDataGrid with SummaryField
14.Fill data from XML to AdvancedDataGridFill data from XML to AdvancedDataGrid
15.Change column header for Hierarchical AdvancedDataGridChange column header for Hierarchical AdvancedDataGrid
16.Hierarchical AdvancedDataGrid CategoriesHierarchical AdvancedDataGrid Categories
17.Displaying hierarchical XML data and use it in AdvancedDataGridDisplaying hierarchical XML data and use it in AdvancedDataGrid
18.An AdvancedDataGrid that displays two summary fields, Min Actual and Max ActualAn AdvancedDataGrid that displays two summary fields, Min Actual and Max Actual
19.Summary Column with AdvancedDataGridSummary Column with AdvancedDataGrid
20.Summary AdvancedDataGrid with SummaryRow and SummaryField2Summary AdvancedDataGrid with SummaryRow and SummaryField2
21.implements the AdvancedDataGrid control shown in the previous figure:implements the AdvancedDataGrid control shown in the previous figure:
22.Regrouping AdvancedDataGridRegrouping AdvancedDataGrid
23.Advanced DataGrid DemoAdvanced DataGrid Demo
24.Advanced DataGrid with Model DataAdvanced DataGrid with Model Data
25.Advanecd DataGrid for NestedGroupsAdvanecd DataGrid for NestedGroups
26.Hierarchical Advanced DataGrid Column GroupingHierarchical Advanced DataGrid Column Grouping