O'Reilly logo

Flex 3 Cookbook by Joshua Noble, Todd Anderson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required