2
votes

I want to implement an Excel like keyboard (arrow) navigation in an Advanced Datagrid in Flex. The docu at http://livedocs.adobe.com/flex/3/html/help.html?content=advdatagrid_11.html states that arrow keys can be used to navigate around cells. However, in my case that does not work. I can only navigate rows up and down

---snip ---

When focus is on the AdvancedDataGrid control:

* Use the Left, Right, Up, and Down Arrow keys to move between cells.
* Use the Shift+Home and Shift+End keys to move to the first and last column in current row.
* Cells are only selected by default, they are not editable.
* Press the F2 key to make a cell editable.

--- snap ---

Any ideas on that?

Thx, Martin

2

2 Answers

3
votes

By default you can select an entire row in the advancedDataGrid. You need to change the selection mode to single cell. Then all the arrows will work

    <mx:AdvancedDataGrid id="myADG"
                         width="100%"
                         height="100%"
                         color="0x323232"
                         selectionMode="singleCell"
                         initialize="gc.refresh();">
1
votes

"do you a suggstion how I could implemente that by starting typing/pressing the enter key I can start editing the cell? Some keydownhandler"

  • Most Flex visual components inherit from UIComponent. UIComponent defines a keyDownHandler, which gets called first to handle keyboard actions. You can override this in an extension to the ADG, and check to see if the keyboard input is alphanumerical. IF so, you can start the edit session by setting the editedItemPosition. Hope this helps!