User Guide

DataGridColumn.width 311
Example
The following example disables sorting of the second column:
// Set grid attributes.
my_dg.setSize(150, 100);
// Set up sample data.
my_dg.addItem({name:"Clark", score:3135});
my_dg.addItem({name:"Bruce", score:403});
my_dg.addItem({name:"Peter", score:25});
// Don’t allow sort of the second column by clicking the header.
my_dg.getColumnAt(1).sortOnHeaderRelease = false;
DataGridColumn.width
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX Professional 2004.
Usage
myDataGrid.getColumnAt(index).width
Description
Property; a number that indicates the width of the column, in pixels. The default value is 50.
Example
The following example makes the width of the first column 50 pixels:
// Create new DataProvider component.
var myDP_array:Array = new Array({name:"Chris", price:"Priceless"},
{name:"Nigel", price:"Cheap"});
//Assign DataProvider to DataGrid.
my_dg.dataProvider = myDP_array;
// Alter DataGrid dimensions.
my_dg.setSize(140, 100);
my_dg.rowHeight = 30;
my_dg.getColumnAt(0).width = 50;