DataGrid.columnNames

Availability

Flash Player 6 (6.0.79.0).

Edition

Flash MX Professional 2004.

Usage

myDataGrid.columnNames

Description

Property; an array of field names within each item that are displayed as columns.

Example

The following example displays the column name in the Output panel when the title is clicked. With a DataGrid instance named my_dg on the Stage, paste the following code in the first frame of the main timeline:

my_dg.setSize(200, 100);
my_dg.columnNames = ["Name", "Description", "Price"];

var dgListener:Object = new Object();
dgListener.headerRelease = function (evt_obj:Object) {
 trace("You clicked on the \"" + my_dg.columnNames[evt_obj.columnIndex] + "\" column.");
}
my_dg.addEventListener("headerRelease", dgListener);