0 Replies Latest reply on Jul 27, 2006 1:26 PM by Newsgroup_User

    DataGrid focus

    Level 7
      In Flash MX 2004

      This is actually a real stumbling block for me...

      I would like to have a row selected after the DataGrid has been populated.
      Much like a list box <select> in html, I would like to make one row
      "selected". It must be navigated to and highlighted to visually indicate the

      However, the focusedCell property does not work when dg.editable=false

      So, I set the dg.editable=true, set the focusedCell to the appropriate row
      and cell then set the dg.editable=false. But this left the chosen cell in an
      editable (textbox) state that you would have to click out of in order to see
      all the contents of that cell. Ugly.

      With the fine suggestion of DMennenoh, I used the .selectedIndex property to
      choose the selected row, but, although the item is in fact selected, the
      datagrid does not navigate to the selected field. It stays on the first row.
      You must scroll through the list to see the selected row.

      Also, "dan mode" suggested dg.setSelected(0) where I supplied the
      index, but the navigate does not happen.

      Is there a way to progarmmatically choose and navigate to a row in a
      DataGrid without having to put a cell into an "edit mode"?

      At this point, I will even accept a way to programmatically "hit enter" to
      allow the focusedCell function to end the "edit mode" on the cell.

      AND, how do I use a listener to trap the "edit mode" and therefore
      programmatically "hit enter" to end it?