Hi Vivian, I don't think if you can use a datagrid without providing a dataprovider to it.
I think the problem with you is that at the load time you are not sure of the number of columns you would be getting from the xml(or excel). For that issue just don't declare every column specifically. Let me know if you are running into some other issue. -Ravi On Mar 16, 6:41 am, Vivian Richard <[email protected]> wrote: > Thanks Ravi. It works perfect. It definitely answers my question but > I thought that this will solve my problem but it did not. What I am > doing is I am trying to convert MS Excel data to put them in datagrid > and also to drive charts. I was able to create columns dynamically > by measuring the row width and the creating and adding the columns. > Now all I need to do is parsing through the excel XML and put those > data in the datagrid cells. I thought that if I can read a cell then I > will also be able to assign value to it. As I see that you are actually > pointing the cell data through datagrid and then by its data provider and > then indexing the columns and rows. Now I tried to populate my > grid like this: > > for(rows) > for(cols) > { > > myDG.dataProvider[rowNo][myDG.columns[colNo].dataField] = value > (rowNo)(colNo) > } > > But it did not work. I believe that it did not work because my datagrid > is a > dynamic datagrid and it does not have a data provider. So these values > are not assigned to any one and that is why is not reflected in datagrid. > > What is your suggestion and what is the possible best solution? > > Regards..... > > On Sun, Mar 15, 2009 at 12:19 PM, Ravi Mishra <[email protected]> wrote: > > > Hi vivian, > > > Check out the following function > > > private function showCellData(rowNo:Number,colNo:Number):void{ > > var cellStr:String = myDG.dataProvider[rowNo][myDG.columns > > [colNo].dataField]; > > Alert.show(cellStr); > > } > > > This does what exactly you are looking for!! > > > Note: I considered 0 as starting index for row as well as column > > > HTH, > > > -Ravi > > > On Mar 15, 12:54 pm, Vivian Richard <[email protected]> wrote: > >> Hi am trying to retrieve the data from a datagrid > >> pointed by its column number and row number. Suppose > >> if 4,5 is given I need to find the value that is > >> stored in column 4 and row 5. How do I do that. > > >> Regards... --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/flex_india?hl=en -~----------~----~----~----~------~----~------~--~---

