2 Replies Latest reply on Jul 4, 2006 12:30 PM by jordan brough

    Incorrect 'rowIndex' property for DataGridEvent

    jordan brough
      I have a datagrid with one editable column, like this:
      [ id ] [ label ] [ cost ]
      [1] [apple] [10]
      [2] [pear] [30]
      [3] [peach] [15]

      The 'cost' column is editable, and when it is changed I need to update our database with the new value. For example, if the user changes the value for row 1 from '10' to '14', I need to tell our database: 'update the item with row id '1' to have value 14'.

      I can't figure out how to reliably get the row 'id' value for the row that was updated. If I capture the itemEditEnd DataGridEvent, I can get the event.rowIndex value, but this does not necessarily correspond to the correct row index of the dataProvider. For example, if the user has re-sorted the datagrid by clicking on a column header, then the event.rowIndex value gives me the display index, but not the correct dataProvider index. Furthermore, I can't seem to find a way to get the values for the other columns through the datagrid object directly.

      Does anyone know how I can access the values for the other columns in the same row that was updated?