Recently, I ran into another issue with DataGrids.  I received a design comp from one of our designers who wanted alpha transparency in a DataGrid for alternating rows, the header, and highlight/selection.  Basically, he wanted something like this (I added a red gradient and vertical stripes on the background to make the alpha more apparent):

StyleableDataGrid

After a quick look through the styles and properties of Flex 3’s DataGrid, I discovered that I wouldn’t be able to do these three requests unless I (once again) subclassed the DataGrid to add these behaviors.

In this component, I added the following styles:


rollOverAlpha
selectionAlpha
alternatingItemAlphas (complements alternatingItemColors)
headerAlphas
headerSeparator (boolean -- draws the column separator on the header)

Note that the alternatingItemAlphas will not appear to work unless DataGrid’s backgroundAlpha style is set to zero.

To see an example with View Source enabled, click here.