And of course it helps to use the correct notation by using binding
with { }:

<mx:DataGrid id="dg" creationComplete="{dg.selectedIndex = 0}" />

:)

--- In [email protected], "Doug Lowder" <[EMAIL PROTECTED]> wrote:
>
> It might depend on how the datagrid is populated with data, but using
> the creationComplete event instead of initialize works for me.  All
> you need to do is set the selectIndex property of the grid.
> 
> creationComplete="mydataGrid.selectedIndex = 0"
> 
> If you populate the grid in the result handler of some data service
> method, then just set the selected index after the grid's dataProvider
> has been updated.
> 
> Doug
> 
> --- In [email protected], "rgwilson26" <ryan.wilson@> wrote:
> >
> > I would like to set focus on load of my component to the first
index of 
> > my datagrid so it is highlighted everytime the component loads. I
tried 
> > have a few things like Initialize="mydataGrid.setFocus
> > (mydataGrid.selectedIndex = 0)" with no luck.
> > 
> > Any suggestions?
> >
>






--
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