User Guide
270 DataGrid component (Flash Professional only)
Description
Method; adds a new column at the specified position. Columns are shifted to the right and
their indexes are incremented. For more information, see “DataGridColumn class (Flash
Professional only)” on page 300.
Example
This example shows two ways to use addColumnAt() and sets the column widths. With a
DataGrid instance named
my_dg on the Stage, paste the following code in the first frame of
the main timeline (notice that it imports the DataGridColumn class first):
import mx.controls.gridclasses.DataGridColumn;
var my_dg:mx.controls.DataGrid;
my_dg.setSize(320, 240);
// Add columns to grid.
my_dg.addColumnAt(0, "Orange");
var orange_dgc:DataGridColumn = my_dg.getColumnAt(0);
orange_dgc.width = 125;
var blue_dgc:DataGridColumn = new DataGridColumn("Blue");
blue_dgc.width = 75;
my_dg.addColumnAt(1, blue_dgc);
DataGrid.addItem()
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX Professional 2004.
Usage
myDataGrid.addItem(item)
Parameters
item An instance of an object to be added to the grid.
Returns
A reference to the instance that was added.