<?xml
version="1.0"?>
<!--
dpcontrols/DataGridVisibleColumn.mxml -->
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml" backgroundGradientAlphas="[1.0,
1.0]" backgroundGradientColors="[#571919,
#571919]" layout="absolute">
<mx:DataGrid
id="myDG" width="350"
x="10" y="52">
<mx:dataProvider>
<mx:ArrayCollection>
<mx:source>
<mx:Object
Artist="Pavement" Price="11.99"
Album="Slanted
and Enchanted" />
<mx:Object
Artist="Pavement"
Album="Brighten
the Corners" Price="11.99" />
</mx:source>
</mx:ArrayCollection>
</mx:dataProvider>
<mx:columns>
<mx:DataGridColumn
dataField="Artist" />
<mx:DataGridColumn
dataField="Album" />
<mx:DataGridColumn
id="price" dataField="Price"
visible="false"/>
</mx:columns>
</mx:DataGrid>
<!-- The column id property
specifies the column to show.-->
<mx:Button
label="Toggle Price Column"
click="price.visible =
!price.visible;" x="97"
y="217"/>
</mx:Application>
No comments:
Post a Comment