This content has been marked as final. Show 3 replies
That is an excellent tutorial, by all means read through it.
But I want to make something very clear in specific response to this question. That is, YOU DO NOT READ DATA FROM A DATAGRID.
As with all data-oriented components in flex, you will almost always be working witht he *dataProvider*.
This is mainly because the DataGrid "rows" do not really exist. Instead, Flex renderers just enough visual row objects to fill the bounds of the DataGrid (plus a few for buffering). It then "recycles" those objects (itemRenderers) whenever the view changes, such as when you scroll, or when the underlying data is changed.
The data in the dataProvider item that corresponds to the row is passed to the renderer, which displays it.
So, if there are 10 visible rows in the DG, that is really all the renderers there are. And if you have 100 items in your data, you cannot do something like get row(33), column(3).
And you cannot "loop over the rows" for the same reason.
You CAN however do all of those things using the dataProvider API.
Thanks Pratap and Tracy for the replies
The tutorial certainly helped. The problem is that I am working with a datagrid which is not displaying the data from a data source (XML file) completely. For debugging purpose, i wanted to read the data in the datagrid.
Anyway, the following link helped me to some extent.