User Guide

Using the DataGrid component (Flash Professional only) 251
Using the DataGrid component (Flash
Professional only)
You can use the DataGrid component as the foundation for numerous types of data-driven
applications. You can easily display a formatted tabular view of a database query (or other
data), but you can also use the cell renderer capabilities to build more sophisticated and
editable user interface pieces. The following are practical uses for the DataGrid component:
A webmail client
Search results pages
Spreadsheet applications such as loan calculators and tax form applications
Understanding the design of the DataGrid
component
The DataGrid component extends the List component. When you design an application with
the DataGrid component, it is helpful to understand how the List class underlying it was
designed. The following are some fundamental assumptions and requirements that
Macromedia used when developing the List class:
Keep it small, fast, and simple.
Dont make something more complicated than absolutely necessary. This was the prime
design directive. Most of the requirements listed below are based on this directive.
Lists have uniform row heights.
Every row must be the same height; the height can be set during authoring or at runtime.
Lists must scale to thousands of records.
Lists dont measure text.
This creates a horizontal scrolling issue for List and Tree components; for more
information, see “Understanding the design of the List component” on page 762. The
DataGrid component, however, supports
"auto" as an hScrollPolicy value, because it
measures columns (which are the same width per item), not text.
The fact that lists dont measure text explains why lists have uniform row heights. Sizing
individual rows to fit text would require intensive measuring. For example, if you wanted
to accurately show the scroll bars on a list with nonuniform row height, youd need to
premeasure every row.