Write a cell renderer and make sure to put var getCellIndex:Function;
Then in setValue set your text to be the return value of calling getCellIndex(). The labelFunction probably isn't going to work. Matt -----Original Message----- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of nahruka Sent: Monday, April 10, 2006 1:07 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Printing the row number in a DataGrid Hi all, I need some help with datagrids in Flex 1.5. How can I implement the getRowNumber function in order to display a column with the proper row number in the DataGrid (beginning by 1)? I have the following code: <mx:Repeater id="repPre" dataProvider="{ArrayUtil.toArray(xmlAlu.ASSIGS.ASSIG)}"> <mx:Label text="{repPre.currentItem.NOM}"></mx:Label> <mx:DataGrid id="dgAlu" dataProvider="{ArrayUtil.toArray(repPre.currentItem.ALUS.ALU)}" change="dgAluChange(event)" width="100%"> <mx:columns> <mx:Array> <mx:DataGridColumn headerText="Row number" labelFunction="getRowNumber" width="80"></mx:DataGridColumn> <mx:DataGridColumn headerText="Name" labelFunction="getName" width="75"></mx:DataGridColumn> </mx:Array> </mx:columns> </mx:DataGrid> </mx:Repeater> -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/