DataGrid.getColumnAt()

Availability

Flash Player 6 (6.0.79.0).

Edition

Flash MX Professional 2004.

Usage

myDataGrid.getColumnAt(index)

Parameters

index The index of the DataGridColumn object to be returned. This number is zero-based.

Returns

A DataGridColumn object.

Description

Method; gets a reference to the DataGridColumn object at the specified index.

Example

The following example gets the DataGridColumn object at index 0 and changes the text. With a DataGrid instance named my_dg and a Button instance named my_btn on the Stage, paste the following code in the first frame of the main timeline:

my_dg.setSize(140, 100);

// Set up sample data.
my_dg.dataProvider = [{name:"Clark", score:3135}, {name:"Bruce", score:403}, {name:"Peter", score:25}];

// Create listener object.
var btnListener:Object = new Object();
btnListener.click = function() {
    // Get column at location 0.
    var a_dgc = my_dg.getColumnAt(0);
    // Change header text.
    a_dgc.headerText = "c";
};

// Add button listener.
my_btn.addEventListener("click", btnListener);