ActionScript 2.0 Components Language Reference |
|
|
|
| DataGrid component > DataGrid.editable | |||
Flash Player 6 (6.0.79.0).
Flash MX Professional 2004.
myDataGrid.editable
Property; determines whether the data grid can be edited by a user (true) or not (false). This property must be true in order for individual columns to be editable and for any cell to receive focus. The default value is false.
If you want individual columns to be uneditable, use the DataGridColumn.editable property.
|
CAUTION |
The DataGrid is not editable or sortable if it is bound directly to a WebServiceConnector component or an XMLConnector component. You must bind the DataGrid component to the DataSet component and bind the DataSet component to the WebServiceConnector component or XMLConnector component if you want the grid to be editable or sortable. |
The following example allows users to edit all the columns of the grid except the first column. 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(140, 100);
// Add columns to grid and add data.
my_dg.addColumn("a");
my_dg.addColumn("b");
my_dg.addItem({a:"one", b:1});
my_dg.addItem({a:"two", b:2});
// Make DataGrid editable.
my_dg.editable = true;
// Make the first column read-only.
my_dg.getColumnAt(0).editable = false;
|
|
|
|