Share the post "Adobe Flex: Change Style Of Header Text In DataGrid"
There is no direct way to set a DataGrid column’s header text to, say, change its font type (bold, italic, etc) or even its alignment. You would have to use a bit of CSS and place it within the tag of your MXML file.
For example, to set a header text’s font type to bold and text alignment to center, use the following code below
|
1 2 3 4 5 6 |
<mx:Style> .centerbold { fontWeight: bold; textAlign: center; } </mx:Style> |
and then, within the DataGridColumn’s property headerStyleName, assign the .centerbold style to it.
|
1 |
<mx:DataGridColumn dataField="user_name" headerStyleName="centerbold"/> |