public var rowIndex:int
The index of the row of the DataGrid, List, or Tree control
relative to the currently visible rows of the control…
The way I managed to achieve what I was after is attached.
That code is inside my custom ItemRenderer component and is called
via the FlexEvent.DATA_CHANGE event. But finding the containing
DataGrid's dataProvider and comparing the current element to that
just seems a strange way of doing things - I'd have thought
BaseListData would expose the absolute index of the current element
as well as the index relative to what's being displayed.
So, does anyone know an easier way of getting the absolute
You're doing it right. As you've found, the Data Grid has no
rows beyond what's being displayed, plus some off-screen rows used
to speed up scrolling.
You have to go to the dataprovider to get the actual
position. So you have to think of the Data Grid as just a view onto
the dataprovider, and that's why there is no "absolute row"
property, as such.
Amy recently shared a cool way of setting line number in a
List control; this may be helpful to you: