data provider contains fields for an artist, album name, and price. : DataGrid « Grid « Flex






data provider contains fields for an artist, album name, and price.

data provider contains fields for an artist, album name, and price.
           
<!--
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/

-->



    <!-- itemRenderers\dataGrid\DGDefaultRenderer.mxml -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx">
    <fx:Script> 
         
        import mx.collections.ArrayCollection; 
        [Bindable] 
        private var initDG:ArrayCollection = new ArrayCollection([ 
            {Artist:'Pavement', Album:'Slanted and Enchanted', Price:11.99}, 
            {Artist:'Pavement', Album:'Brighten the Corners', Price:11.99} 
        ]); 
      
    </fx:Script>
    <mx:Panel paddingTop="10" paddingBottom="10" paddingLeft="10"
        paddingRight="10">
        <mx:DataGrid id="myGrid" dataProvider="{initDG}" width="100%"
            editable="true">
            <mx:columns>
                <mx:DataGridColumn dataField="Artist" resizable="true" />
                <mx:DataGridColumn dataField="Album" resizable="true" />
                <mx:DataGridColumn dataField="Price" resizable="true" />
            </mx:columns>
        </mx:DataGrid>
    </mx:Panel>
</s:Application>

   
    
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Scroll DataGridScroll DataGrid
2.Set selected index for DataGridSet selected index for DataGrid
3.Variable row heightsVariable row heights
4.Multi-line data grid rowMulti-line data grid row
5.variable scope for DataGridvariable scope for DataGrid
6.Creating inline item renderer and editorCreating inline item renderer and editor
7.Using a DataGridUsing a DataGrid
8.Formatting grid lines with CSSFormatting grid lines with CSS
9.Set editing position for DataGridSet editing position for DataGrid
10.Append new value to DataGrid from Form fieldsAppend new value to DataGrid from Form fields
11.Item click event for DataGridItem click event for DataGrid
12.Editable DataGridEditable DataGrid
13.Variable row height DataGridVariable row height DataGrid
14.DataGrid change eventDataGrid change event
15.Use Panel to layout controls and hold DataGridUse Panel to layout controls and hold DataGrid
16.DataGrids take a dataProvider to populate themDataGrids take a dataProvider to populate them
17.Default setting for DataGridDefault setting for DataGrid
18.Call HTTP server and set result to DataGrid
19.Binding XML to DataGridBinding XML to DataGrid
20.DataGrid Configuration through ActionScriptDataGrid Configuration through ActionScript
21.DataGrid Validate NowDataGrid Validate Now
22.DataGrid Validate Now Selected indexDataGrid Validate Now Selected index
23.DataGrid with static string valuesDataGrid with static string values
24.DataGrid DataDataGrid Data
25.DataGrid EventsDataGrid Events
26.Sort a DataGridSort a DataGrid
27.Inline DataGrid Image ScopeInline DataGrid Image Scope
28.Print DataGrid outPrint DataGrid out
29.Enabling the user to move many items at onceEnabling the user to move many items at once