Chapter 6. DataGrid and Advanced DataGrid

The DataGrid control is a list-based control optimized to display large data sets in a multicolumn layout. The DataGrid control features resizable columns, customizable item renderers, and sorting capabilities, among other features. Flex 3 adds two new controls to the DataGrid family: AdvancedDataGrid and OLAPDataGrid. The AdvancedDataGrid control expands on the DataGrid control to add extra data visualization capabilities such as data aggregation, data formatting, multicolumn sorting, and so on. This is similar to the functionality of Pivot Tables in Microsoft Excel. The AdvancedDataGrid and OLAPDataGrid controls are available with the data visualization framework that is bundled with the Flex Builder 3 Professional Edition.

The two DataGrid controls are typically used to display arrays or collections of data objects with similar types. The AdvancedDataGrid control can also display HierarchicalData objects, show the parent-child relationships among complex data objects, and allow for the creation of specialized groupings of data.

6.1. Create Custom Columns for a DataGrid

Problem

You need to specify custom columns for a DataGrid and explicitly control the display.

Solution

Use the DataGridColumn tag to specify custom properties for columns in a DataGrid.

Discussion

This recipe adds three DataGridColumn tags to the columns property of a DataGrid. It uses the homesforsale.xml data file. The DataGridColumn tags specify the order in which to display ...

Get Flex 3 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.