Search code examples
apache-flexdatagridheadertransparentflex-spark

Flex 4.5 - Transparent Background on Spark DataGrid Headers


In short, I am attempting to get this result:

Spark DataGrid

I almost got it, but the part that's giving me trouble is making the header background transparent. I am making a custom MXML skin based on the default Spark DataGrid skin. I tried setting the contentBackgroundAlpha to 0 on the columnHeaderGroup and the headerRenderer, but that didn't work. I tried setting visible to false for either of those, but that made it so that the text didn't show up either, so that didn't work. There is no setting for backgroundAlpha in either of those two, so I'm not sure what else to try.

Any help would be greatly appreciated. Thanks!


Solution

  • Copy everything from default header renderer... then remove everything that says "s:Rect", then set that as your header renderer for each column. Here's the code you should end up with as your header renderer: http://pastebin.com/XPu1cSK9

    You don't even need to make a skin for the datagrid.