0 Replies Latest reply on Sep 13, 2007 12:05 PM by levancho

    itemRendererToIndex throws NPE when item is out of  bounds hidden by scrollbar

    levancho Level 3
      when I try to programaticaly select item in a dataGrid and I know that this item for sure exits, if it is visible it works fine with following code :

      myDataGrid.itemRendererToIndex(myDataGrid.itemToItemRenderer(item));

      but if I scroll grid up and that item gets hidden this code myDataGrid.itemRendererToIndex(myDataGrid.itemToItemRenderer(item)); breaks on

      TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at mx.controls.listClasses::ListBase/itemRendererToIndex()
      at mx.controls.dataGridClasses::DataGridBase/itemRendererToIndex()

      is it flex intended behaviour?
      I know that datado have that item in it its just hidden, because list is big and I scrolled down.

      if so what options I can use to get around that, (can I programatically scroll grid back to make that item vissible before running this code somehow?)