# Problems with AS3 and Dataprovider/Datagrid

**URL:** <https://forum.kirupa.com/t/problems-with-as3-and-dataprovider-datagrid/260034>\
**Category:** flash\
**Created:** [May 11, 2008, 11:07pm UTC](https://forum.kirupa.com/t/problems-with-as3-and-dataprovider-datagrid/260034 "2008-05-11T23:07:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![FlashNeo](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/flashneo/32/2143_2.png) [@FlashNeo](https://forum.kirupa.com/u/FlashNeo)\
**Post date:** [May 11, 2008, 11:07pm UTC](https://forum.kirupa.com/t/problems-with-as3-and-dataprovider-datagrid/260034/1 "2008-05-11T23:07:46Z")

</div>

Before I go crazy please tell me why the content of the datagrid does not get populated?The headings work but for some reason the dataprovider doesn’t seem to be functioning.

I am receiving the following XML from a PHP script  
\<member\>  
\<webhost\>sdflsdkfn\</webhost\>  
\<webhostEx\>2008-05-12\</webhostEx\>  
\<domain\>sfsdf\</domain\>  
\<domainEx\>2008-05-11\</domainEx\>  
\<businessCard\>sfsdfs\</businessCard\>  
\</member\>

Here is the AS3.0 code:  
//trace(anEvent.target.data);  
var myXML:XML = XML(anEvent.target.data);  
var dp:DataProvider = new DataProvider(myXML);  
trace(myXML);  
var columnArray = [];  
trace(myXML.children().length());  
for (var x:Number = 0; x \< myXML.children().length(); x++) {  
columnArray[x] = new DataGridColumn(String(myXML.children()[x].name() ));  
}trace(‘here’);  
columnArray[0].width = 150;  
columnArray[1].width = 50;  
columnArray[2].width = 75;  
columnArray[3].width = 75;  
columnArray[4].width = 75;  
for (x = 0; x \< myXML.children().length(); x++) {  
myDataGrid.addColumn( columnArray[x] );  
}

myDataGrid.dataProvider = dp;  
myDataGrid.width = 500;  
myDataGrid.rowCount = dp.length;  
myDataGrid.move(10, 10);  
myDataGrid.sortableColumns = false;  
addChild(myDataGrid);
