# Get affected cell out of DataGrid

**URL:** <https://forum.kirupa.com/t/get-affected-cell-out-of-datagrid/234728>\
**Category:** Uncategorized\
**Created:** [August 5, 2007, 12:50pm UTC](https://forum.kirupa.com/t/get-affected-cell-out-of-datagrid/234728 "2007-08-05T12:50:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![oaki](https://avatars.discourse-cdn.com/v4/letter/o/7993a0/32.png) [@oaki](https://forum.kirupa.com/u/oaki)\
**Post date:** [August 5, 2007, 12:50pm UTC](https://forum.kirupa.com/t/get-affected-cell-out-of-datagrid/234728/1 "2007-08-05T12:50:35Z")

</div>

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?

```auto

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);
}

```
