I will answer, but you probably won't like the answer.
This is simply not possible. In order to optimize performance, DataGrid and the other list components only create(render) the visible elements. If a row is not visible, it does not exist. You can't look sideways into your tv screen and see beyond the edges. You must do wok like this using the dataProvider. What are you trying to do? Tracy Spratt, Lariat Services, development services available _____ From: [email protected] [mailto:[email protected]] On Behalf Of Mike Sent: Friday, February 12, 2010 4:06 PM To: [email protected] Subject: [SPAM] [flexcoders] Obtaining rendered text from a DataGrid I need extract the rendered text from all cells of a DataGrid, whether or not they are all displayed. The following code dies because renderer is null: public var dp:ArrayCollection = new ArrayCollection(); /** Obtain formatted text data from the DataGrid's dataProvider. * Other data generated by item renderers such as images are ignored. */ protected function extractData(originalComponent:*):void { var dg:DataGrid = DataGrid(originalComponent); for (var col:int=0; col<dg.columnCount; col++) { var rowArray:Array = []; for (var row:int=0; row<dg.rowCount; row++) { var index:int = dg.indicesToIndex(row, col); var renderer:IListItemRenderer = dg.createItemRenderer(index); var value:* = renderer.data; rowArray.push(value); } dp.addItem(rowArray); } } Most of my posts to this group go unanswered. Hopefully this one won't suffer the same fate! :) Mike

