AS2.0 created DataGrid Problems

Hi,
I’m trying to load a number of rows into a DataGrid via a DataSet.
The data comes in from an external source in the form of an XML and the DataSet schema is set,with the DataSet Having an instance on stage by the name of “myDS”

If I drag and drop a dataGrid component onto the stage and then bind it to the DataSet through the Bindings tab, it works fine.

But my main goal is to create a grid via code and then load it.

First a function is called
“initializeGrid()”
This function creates the DataGrid and the sets the dataProvider of the dataGrid to that of myDS.

ie.


//DGHolder is an empty movie Clip positioned on stage.
  DGHolder.createClassObject(DataGrid, "myDG", _root.getNextHighestDepth());
  DGHolder.myDG.setSize(911,280);
  DGHolder.myDG.dataProvider = myDS.dataProvider;

The grid gets created successfully, and then a call is made to get the data, and parse it into an array and set the dataProvider of the DataSet to that array

i.e. in psuedocode


 
....
{
    //Parse data into array called rowsData.
}
myDS.dataProvider = rowsData;
 

.

However this fails to populate the datagrid of anyrows whtsoever :(…
If I replace the above statement and instead jut put in
“DGHolder.myDG.dataProvider = rowsData” it works, but I need the DataSet for formatting and order of columns…

Can anyone please let me know why setting the DataProvider of the DataSet fails to populate any rows into the DataGrid ? And how I can fix it?

Thanks

~TNE