Following from my previous post about datagrid cellpress event. i'm 
checking the selectedIndex property. the rowIndex is correct but the 
selectedIndex is incorrect. its always my previous rowIndex


<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml"; 
backgroundColor="#FFFFFF">

        <mx:Script>
        <![CDATA[
         import mx.events.DataGridEvent;
                                                
        private function doCellPress(event:DataGridEvent):void
        {
         out.text += "rIndex="+event.rowIndex + " sIndex=" + 
dg.selectedIndex + "\n";
        }
        ]]>
        </mx:Script>
       
    <mx:DataGrid id="dg" width="60%" height="60%" 
cellPress="doCellPress(event)">
  <mx:dataProvider>
   <mx:Object Artist="Pavement7" Price="14.99" Album="Slanted and 
Enchanted" />
   <mx:Object Artist="Pavement8" Album="Brighten the Corners" 
Price="3.99" />
   <mx:Object Artist="Pavement9" Price="21.99" Album="Slanted and 
Enchanted" />
   <mx:Object Artist="Pavement10" Album="Brighten the Corners" 
Price="1.99" />
    <mx:Object Artist="Pavement11" Price="41.99" Album="Slanted and 
Enchanted" />
    <mx:Object Artist="Pavement12" Album="Brighten the Corners" 
Price="7.99" />
  </mx:dataProvider>
 <mx:columns>
  <mx:DataGridColumn columnName="Album" />
   <mx:DataGridColumn columnName="Price" />
 </mx:columns>
 </mx:DataGrid>
        
        <mx:TextArea id="out" height="120" width="150"/>

</mx:Application>






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to