On 5/8/07, Mike_Robinson_98 <[EMAIL PROTECTED]> wrote: > Has anyone come up with a good way to let a user move up/down in an > editable column of a datagrid using the keyboard? These columns use a > TextInput as the itemEditor. > > Right now I use a handler for the keyFocusChangeEvent on the datagrid > to handle TAB and Shift-TAB keys to move horizontally through the > rows. However, moving up/down in the columns is more difficult because > the editor's TextInput captures the Return key and the > TextFieldAutomationHelper class captures all the other interesting > keystrokes (navigation keys like UP and DOWN arrows) and it seems the > DataGrid is only interested in the TAB key when it handles focusChange > events.
This simple test worked for me: <?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*"> <mx:DataGrid id="dg" editable="true" keyDown="handleKeyDown()"> <mx:dataProvider> <mx:Object name="foo" value="1" /> <mx:Object name="bar" value="2" /> </mx:dataProvider> </mx:DataGrid> <mx:Script> private function handleKeyDown():void { var v:Object = dg.editedItemPosition; v.rowIndex++; dg.editedItemPosition = v; } </mx:Script> </mx:Application> Use the down arrow key to move from foo to bar.

