How Do I Do This?

ONLY 3 STEPS!
[LEFT]
[/LEFT]

  1. I have a DataGrid named dataGrid1. This DataGrid contains specific data.

  2. I have another DataGrid named dataGrid2. This DataGrid is used as a sorting solution for dataGrid1 - anything the user types in a column on this DataGrid filters the corresponding column in dataGrid1. There is only one row, and the dataProvider on the one and only row, on each column, is equal to the name of the dataProvider on the corresponding column in dataGrid1. This DataGrid also has an ITEM_CLICK eventlistener. The function this eventlistener calls is named filterData().
    This is what the eventlistener looks like:
    [AS]dataGrid2.addEventListener(ListEvent.ITEM_CLICK,
    function(event:ListEvent):void {
    filterData(event, dataGrid2.columns, dataGrid2.selectedIndex, dataGrid2.selectedItem);
    });[/AS]

  3. filterData() needs to get:
    a) the row that’s being clicked on
    b) the dataProvider of dataGrid1 (to do the filtering on)

Now, filterData() looks like this:
[AS]private function filterData(event:ListEvent, columns:Array, index:Number, row:Object ):void {
//THE FOLLOWING NEEDS TO BE DYNAMIC
trace(event.currentTarget.selectedItem.???);
}[/AS]

So, the question is: HOW do I get the selectedItem to be dynamic???

PLEASE HELP!!!