Grid Flex



    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx" initialize="initData();">
    
         
        import mx.collections.ArrayList; 
        [Bindable] 
        private var DGArray:ArrayList = new ArrayList([ 
        {Artist:'Pavement', Album:'Slanted and Enchanted', Price:11.99}, 
        {Artist:'Pavement', Album:'Brighten the Corners', Price:11.99}]); 
        // Initialize initDG ArrayList variable from the ArrayList. 
        public function initData():void { 
            myGrid.dataProvider = DGArray; 
            myGrid.validateNow(); 
            myGrid.selectedIndex=1; 
        }