DataGrid.columnCount

Availability

Flash Player 6 (6.0.79.0).

Edition

Flash MX Professional 2004.

Usage

myDataGrid.columnCount

Description

Property (read-only); the number of columns displayed.

Example

The following example displays the total number of columns in the Output panel. With a DataGrid instance named my_dg on the Stage, paste the following code in the first frame of the main timeline:

// Add columns to grid and add data.
my_dg.addColumn("a");
my_dg.addColumn("b");

my_dg.addItem({a:"one", b:"two"});

// Get number of columns in grid.
var colCount_num:Number = my_dg.columnCount;
trace("Number of columns: "+colCount_num);