# DataGrid+XML! Cool, now what was selected?

**URL:** <https://forum.kirupa.com/t/datagrid-xml-cool-now-what-was-selected/248571>\
**Category:** Uncategorized\
**Created:** [January 9, 2008, 8:12pm UTC](https://forum.kirupa.com/t/datagrid-xml-cool-now-what-was-selected/248571 "2008-01-09T20:12:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kenc3dan](https://avatars.discourse-cdn.com/v4/letter/k/bb73d2/32.png) [@kenc3dan](https://forum.kirupa.com/u/kenc3dan)\
**Post date:** [January 9, 2008, 8:12pm UTC](https://forum.kirupa.com/t/datagrid-xml-cool-now-what-was-selected/248571/1 "2008-01-09T20:12:06Z")

</div>

Hi,  
I have a DataGrid in my scene and I’ve figured out how to populate it with XML using AS3.  
The only thing I can’t figure out is how to determine which element has been clicked on.  
It’s not an editable grid, I just want to handle when someone selects a row in the grid and display that rows elements.  
Thanks for ANY help. I’m so close.

```auto
myDataGrid.addEventListener(SELECT, mySelectHandler);
returns the error...
ReferenceError: Error #1065: Variable SELECT is not defined.

myDataGrid.addEventListener(Event.CHANGE, mySelectHandler);
returns the error...
TypeError: Error #1034: Type Coercion failed: cannot convert flash.events::Event@3aa94471 to fl.events.DataGridEvent.
	at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
	at flash.events::EventDispatcher/dispatchEvent()
	at fl.controls::SelectableList/fl.controls:SelectableList::handleCellRendererClick()
	at fl.controls::DataGrid/fl.controls:DataGrid::handleCellRendererClick() 								 								 								 															 								 									 								 								 								 								 								 								 								 								 									 	 		        		  			

```
