# Datagrid issue

**URL:** <https://forum.kirupa.com/t/datagrid-issue/286567>\
**Category:** Uncategorized\
**Created:** [April 17, 2009, 6:22am UTC](https://forum.kirupa.com/t/datagrid-issue/286567 "2009-04-17T06:22:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ric373](https://avatars.discourse-cdn.com/v4/letter/r/ed655f/32.png) [@Ric373](https://forum.kirupa.com/u/Ric373)\
**Post date:** [April 17, 2009, 6:22am UTC](https://forum.kirupa.com/t/datagrid-issue/286567/1 "2009-04-17T06:22:13Z")

</div>

Hello everyone,

I have a little problem with the DataGrid component. It’s a very simple DataGrid with 1 column to get some stuff out of a database and list it.

The issue is that I use the same flash file for different languages, which means that the header of that columns has to be the correct word in every language. (different languages are loaded through different language txt files).

Here is the simplified piece of AS code that I have:

```auto
 
dg.columnNames = ["col"];
 
var arr = new Array();
for (var i = 0; i<data_array.length; i++) {
 arr.push({col:i});
}
dg.dataProvider = arr;

```

This works great, but if however I want to change the name of the column in the variable that I´m using for the column name like:

```auto
 
dg.columnNames = [_root.colName];
 
var arr = new Array();
for (var i = 0; i<data_array.length; i++) {
 arr.push({_root.colName:i});
}
dg.dataProvider = arr;

```

It’s giving me the compiler error: ‘:’ expected

Does anyone how to fix this?
