Worked great, thanks! -david
--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote: > > Call validateNow() then set editedItemPosition. > > > > You might also want to check out an example on my blog > (http://blogs.adobe.com/aharui/2008/03/custom_arraycollections_adding.ht > ml > > > > ________________________________ > > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On > Behalf Of David Barrett > Sent: Tuesday, March 18, 2008 9:25 PM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Automatically selecting the first cell of a new > row in an editable DataGrid > > > > When adding a new row to a DataGrid, how can I automatically give it > keyboard focus? > > Basically, take your standard editable DataGrid: > > <mx:DataGrid id="blah" editable="true"> > <mx:columns> > <mx:DataGridColumn dataField="first"/> > <mx:DataGridColumn dataField="second"/> > </mx:columns> > </mx:DataGrid> > > And give it some data: > > var data:ArrayCollection = new ArrayCollection( [ { first: 1, second: > 2 }, { first: 3, second: 4 } ] ); > blah.dataProvider = data; > > And then add a new row: > > data.addChild( { first: 5, second: 6 } ); > > How can I set the keyboard focus to the item editor for the first > column of the new row? > > Thanks! > > -david >