I'm running into a strange problem.  I'm trying to catch the right-click on a DataGrid row and assign the selectedItem value of the DataGrid to it.  Below is the even handler for the context menu popup:

    public function contextMenuPopup(e:ContextMenuEvent):void
    {
      if (e && e.mouseTarget && e.mouseTarget is DataGridItemRenderer &&
          DataGridItemRenderer( e.mouseTarget).data is ActivityAlert)
      {
        var data:ActivityAlert = ActivityAlert(DataGridItemRenderer( e.mouseTarget).data);
        var i:int = ArrayCollection(grid.dataProvider).getItemIndex(data);
        grid.selectedItem = data;
      }
    }

This works fine until I click to sort the grid.  Then when I right-click on the row and step through it, I find that the "grid.selectedItem = data" line does nothing.  The data var is set to a valid object that can be found in the dataprovider (as shown by the test line that does the getItemIndex).  After this code, the grid.SelectedItemIndex is set properly.  But grid.selectedItem always equals null.  I've tried tracing through the DataGrid code for this but it's fairly complex.

Any idea on why this doesn't work?

--
Jason __._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to