1 Reply Latest reply on Jan 8, 2007 9:23 AM by FlightGuy

    Best Practice to ref selectedItem in DataGrid

      I have a datagrid and with a double click event: doubleClick="viewItem(event);"
      In my viewItem() function I can reference the selectedItem using the dataGridID.selectedItem.property notation but I thought it was best practice to use the event object as follows:

      private function viewItem (event:Event):void {
      Alert.show( event.target.selectedItem.property.toString() );

      However when I try this I get the following error:

      ReferenceError: Error #1069: Property selectedItem not found on mx.controls.dataGridClasses.DataGridItemRenderer and there is no default value.

      Is it possible to reference a property this way in a dataGrid and is it best practice?