Try something like: Public class MyIndexItemRenderer extends DataGridItemRenderer { Override public function validateProperties():void { super.validateProperties(); text =(listData.rowIndex + DataGrid(owner).verticalScrollPosition).toString(); } }
You'll have to fix up capitalization and add imports statements. Alex Harui Flex SDK Developer Adobe Systems Inc.<http://www.adobe.com/> Blog: http://blogs.adobe.com/aharui From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of nylarch Sent: Friday, February 27, 2009 2:16 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] display row index in DataGrid this seems like it should be easy but.... I have a DataGrid with 3000+ rows - an XML object is the dataprovider. Need to show a row index both on the initial display and after various filters the user can run (by state name, county name, etc.) I always want the row index to start at "1" i.e. show the number of rows in the grid. I'm seeing some blog posts where the dataprovider is an ArrayCollection and then the labelFunction can return arrayname.indexOf(item) but this doesn't apply for me. Do I have to go with an ItemRenderer just to use listData.rowIndex()? Is there something easier I'm missing? thanks....