Hi Boulent,
This is how I construct a datagrid and populate it from my web service. Hope it helps:
Code:
//this is what happens when the webservice returns successfully
function getStoriesGood(re:ResultEvent):Void{
//create array
var storiesDP:Array=new Array();
//loop over web service results
for (var i=0; i<re.result.length; i++){
// and add results to array
storiesDP.addItem({StoryID:i,Headline:re.result[i].HEADLINE, Story:re.result[i].STORY, Posted:re.result[i].STORY_DATE})
}
//create datagrid object and set properties
section_mc.form_mc.createObject("DataGrid", "stories_dg");
section_mc.form_mc.stories_dg._x = leftAlign;
section_mc.form_mc.stories_dg._y = topAlign+50;
section_mc.form_mc.stories_dg.multipleSelection = false;
section_mc.form_mc.stories_dg.setSize(500, 350);
//tell datagrid to get data from array
section_mc.form_mc.stories_dg.dataProvider = storiesDP;
section_mc.form_mc.stories_dg.sortItemsBy("StoryID", "ASC");