Setting header styles

You can set header styles through headerStyle, which is a style property itself. To do this, you create an instance of CSSStyleDeclaration, set the appropriate properties on that instance for the header, and then assign the CSSStyleDeclaration to the headerStyle property, as shown in the following example.

import mx.styles.CSSStyleDeclaration;
var headerStyles = new CSSStyleDeclaration();
headerStyles.setStyle("fontStyle", "italic");
grid.setStyle("headerStyle", headerStyles);