thanks for reply. "selectedItem" works perfect in the described case, but it doesn't seem to work with
selectionMode="multipleCells"; selectedItem returns null in this case. Documentation states that "selectedCells" needs to be used. However,selectedCells does not contain data itself, it has "rowIndex" that points to the row number, but not to the index in dataprovider. So, the question is: how to get the clicked row (or cell) data if rowIndex is not pointing to DP and selectedItem is null? --- In [email protected], shaun <[EMAIL PROTECTED]> wrote: > > > Djamshed wrote: > > When you open children in AdvancedDataGrid which uses Hierarchical > > data, rowIndex in selectedCells does not refer to the ADG's > > dataprovider index. > > > > Here is the example: http://djamshed.googlepages.com/grid.html > > Source is here: http://djamshed.googlepages.com/Grid.mxml.html > > > > Open a child node and DOUBLE CLICK on any cell of a child, rowIndex > > seems correct (in terms of reflecting the row number), but this > > rowIndex definitely does NOT REFER to the index in dataprovider. Is > > there any way to get the selected data? > > > > PS: ADG's variable named "firstCellSelectionData" seems like keeping > > the correct value, but it is private. Looked at the source of ADG, it > > says that everything it keeps is found in selectedCells, so the story > > begins from scratch. > > > > There is a lot of good information in the help/API docs section of Flex > Builder. > If you have a quick glance through the API docs you'll see the following > two properties, selectedItem and selectedItems which might be > appropriate for your situation. > > > -------------------------------------------------------------- > selectedItem property > selectedItem:Object [read-write] > A reference to the selected item in the data provider. > > The default value is null. > > This property can be used as the source for data binding. > > > Implementation > public function get selectedItem():Object > public function set selectedItem(value:Object):void > > -------------------------------------------------------------- > > selectedItems property > selectedItems:Array [read-write] > An Array of references to the selected items in the data provider. The > items are in the reverse order that the user selected the items. > > The default value is [ ]. > > This property can be used as the source for data binding. > > > Implementation > public function get selectedItems():Array > public function set selectedItems(value:Array):void > > > -------------------------------------------------------------- > > HTH. > - shaun >

