Get affected cell out of DataGrid

Hi,

I’m trying to do the following:

I’ve got a DataGrid component on the stage and I want to trace additional data (which is assigned to each cell), when leaving the cell.

But when I use the following code, i get an error because e.item is null and I wanted to access its id property.

Can anyone explain to me why this doesn’t work?


import fl.data.DataProvider;
import fl.controls.DataGrid;
import fl.events.DataGridEvent;
import fl.controls.dataGridClasses.DataGridColumn;

var dataGrid:DataGrid = new DataGrid();
var dp:DataProvider = new DataProvider();

dp.addItem( { label: "hello", id: 234 } );

dataGrid.dataProvider = dp;
dataGrid.addEventListener(DataGridEvent.ITEM_EDIT_END, updateDB);

function updateDB(e:DataGridEvent):void {
    trace(e.item.id);
}