User Guide

254 DataGrid component (Flash Professional only)
multipleSelection is a Boolean value that indicates whether multiple items can be selected
(
true) or not (false). The default value is false.
rowHeight indicates the height of each row, in pixels. Changing the font size does not change
the row height. The default value is 20.
You can write ActionScript to control these and additional options for the DataGrid
component using its properties, methods, and events. For more information, see “DataGrid
class (Flash Professional only)” on page 262.
Creating an application with the DataGrid component
To create an application with the DataGrid component, you must first determine where your
data is coming from. The data for a grid can come from a recordset that is fed from a database
query in Macromedia ColdFusion, Java, or .Net using Flash Remoting. Data can also come
from a data set or an array. To pull the data into a grid, you set the
DataGrid.dataProvider
property to the recordset, data set, or array. You can also use the methods of the DataGrid and
DataGridColumn classes to create data locally. Any Array object in the same frame as a
DataGrid component copies the methods, properties, and events of the DataProvider API.
To use Flash Remoting to add a DataGrid component to an application:
1. In Flash, select File > New and select Flash Document.
2. In the Components panel, double-click the DataGrid component to add it to the Stage.
3. In the Property inspector, enter the instance name myDataGrid.
4. In the Actions panel on Frame 1, enter the following code:
myDataGrid.dataProvider = recordSetInstance;
The Flash Remoting recordset recordSetInstance is assigned to the dataProvider
property of
myDataGrid.
5. Select Control > Test Movie.
To use a local data provider to add a DataGrid component to an application:
1. In Flash, select File > New and then select Flash Document.
2. In the Components panel, double-click the DataGrid component to add it to the Stage.
3. In the Property inspector, enter the instance name myDataGrid.
NOTE
When you bind data to the DataGrid component using the Data components, the object
binds columns backward (similar to looping over an object or array). Therefore, to order
the data in the DataGrid component differently, you must explicitly define columns.