# How to use the DataGrid Component?

**URL:** <https://forum.kirupa.com/t/how-to-use-the-datagrid-component/35588>\
**Category:** Uncategorized\
**Created:** [November 15, 2003, 7:28pm UTC](https://forum.kirupa.com/t/how-to-use-the-datagrid-component/35588 "2003-11-15T19:28:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Voetsjoeba](https://avatars.discourse-cdn.com/v4/letter/v/ac91a4/32.png) [@Voetsjoeba](https://forum.kirupa.com/u/Voetsjoeba)\
**Post date:** [November 15, 2003, 7:28pm UTC](https://forum.kirupa.com/t/how-to-use-the-datagrid-component/35588/1 "2003-11-15T19:28:21Z")

</div>

Hello everybody 🙂

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 ?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 15, 2003, 8:11pm UTC](https://forum.kirupa.com/t/how-to-use-the-datagrid-component/35588/2 "2003-11-15T20:11:26Z")

</div>

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:

```auto
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’:

```auto

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 15, 2003, 8:35pm UTC](https://forum.kirupa.com/t/how-to-use-the-datagrid-component/35588/3 "2003-11-15T20:35:26Z")

</div>

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

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