Use ActionScript to configure controls
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
private function myGrid_initialize():void {
myGrid.dataProvider = [
{Artist:'A', Album:'A1', Price:8.99},
{Artist:'B', Album:'B1', Price:1.99},
{Artist:'C', Album:'C1', Price:1.99},
{Artist:'D', Album:'D1', Price:9.99} ];
}
</mx:Script>
<mx:DataGrid id="myGrid" width="350" height="150" color="#7B0974" creationComplete="myGrid_initialize();"/>
</mx:Application>
Related examples in the same category