RE: [flexcoders] Re: Can anyone help on getting data from a grid cell .. I know the row/column index

2007-02-27 Thread Robert Chyko
yourDataGrid.addEventListener(ListEvent.ITEM_CLICK, setColumnCopy); function setColumnCopy(){ _selectedCol = yourDataGrid.columns[event.columnIndex].dataField; Alert.show(yourDataGrid.selectedItem[_selectedCol]); } -Original Message- From: flexcoders@yahoogroups.com [ma

Re: [flexcoders] Re: Can anyone help on getting data from a grid cell .. I know the row/column index

2007-02-26 Thread leds usop
I think my last lines are a bit vague and confusing. It isnt the actual index in the dataprovider.. but rather the offset in the data provider of properties depending on how you have laid out your elements. So the reliability of this method depends - needless to say - your prior knowledge of how th

Re: [flexcoders] Re: Can anyone help on getting data from a grid cell .. I know the row/column index

2007-02-26 Thread leds usop
OMG i just realized I just gave you the reverse of what you are asking for haha. my bad. anyway, try using datagrid's indicesToIndex() method. It will return the index (in your dataprovider)... I assume you can then look up your dataprovider to determine which item/prop/text is which? :) Cheers!

Re: [flexcoders] Re: Can anyone help on getting data from a grid cell .. I know the row/column index

2007-02-26 Thread leds usop
Hi listen for the itemclickevent and then use specifically ListEvent as the event type paramter of the listener then use the rowIndex and columnindex properties like so: private function test(e:ListEvent):void{ trace(e.rowIndex.toString()); trace(e.columnIndex.toString()); } be aware however that

Re: [flexcoders] Re: Can anyone help on getting data from a grid cell .. I know the row/column index

2007-02-26 Thread André Rodrigues Pena
It's not usual to access data from the grid, you access data from it's dataprovider that is normally either a ArrayCollection or a XML object. Imagine your grid has the following data provider: var xml:XML = ; So you can access data this way: [EMAIL PROTECTED] will return Roger. [EMAIL PROT