How to use the DataGrid Component?

Hello everybody :slight_smile:

I’m currently building an application in Flash to display and edit values from different tables and databases in MySQL. I’m at the point to display the entries in Flash, and I thought I’d use the DataGrid component for this.

But how do I use this ? I have the arrays with the values, I have the array with the column names, but how do I get the DataGrid component to display the values of these arrays ? I’ve been reading in the manual, but it didn’t give any good examples of how to do this.

Can anyone tell me how to use this component ?

Ok, this is driving me INSANE !! I drag a DataGrid component to stage, give it the instane name myDataGrid, and I apply this example code I found in the AS Reference:

myDP = new Array({name:"Chris", price:"Priceless"}, {name:"Nigel", price:"Cheap"});
myDataGrid.dataProvider = myDP;

That works perfectly. When I use this in my application, it just doesn’t work and it’s the same friggin’ code ! It’s driving me insane, it should work, but it just doesn’t ! Why on earth not ? This is the code I used with a DataGrid on stage with the instance name ‘entries’:


getEntries = function(){
myDP = new Array({name:"Chris", price:"Priceless"}, {name:"Nigel", price:"Cheap"});
entries.dataProvider = myDP;
}
get_entries.onRelease = function(){
getEntries();
}

Please help me out here. I hate MX 2004 for things like this. Argh.

[size=16]D’oh !![/size]

Had to export using ActionScript 2.0 :stuck_out_tongue: Let this be a lesson.