1 Reply Latest reply on Jun 15, 2007 9:26 AM by TucsonJava

    actualRowIndex no longer valid

    TucsonJava Level 1
      Hi,

      I have a datagrid with several editors/renders. If I tab through the grid and then out into the main form and I eventually end up back at the last item in the grid that had an editor activated. That's OK.

      However, if I delete several rows from the end of the grid after I tab out of the grid (like above). Then when I tab back to the grid I get an exception "Error #1010: A term is undefined and has no properties". In the datagrid class, it is attempting to get a reference to the last cell that was edited (listItems[actualRowIndex][actualColIndex]) where actualRowIndex points to the last row edited but no longer exists since it was deleted in the meantime.

      How to handle this? I have an endEdit method that always calls the destroyItemEditor when an edit is complete. I would expect the destroyItemEditor to handle updating the actualRowIndex, but it apparently does not. Is there anything else I need do when removing a row from the datagrid other than something like this ...

      datagridref.dataProvider.removeItemAt(index);

      I figure I must be doing something wrong but can't figure it out.
        • 1. Re: actualRowIndex no longer valid
          TucsonJava Level 1
          A bit more information. What seems to be happening is I delete 2 or more rows (one after the other in quick succession) from the end of the datagrid and try the test above, the error occurs. I look at properties of the datagrid object and find that all the listItems did not get deleted - only the 1st one.

          However, the application appears to have all the rows deleted. The display is correct on the screen, the order total (these are order items) was recalculated as if all the rows were removed. Yet, in the datagrid one or more of the rows is still there. Could this be something to do with timing?