If you want to make your own headerRenderer, then it is obviously very simple to just set the toolTip property in your renderer. But I was curious if it could easily be done with out a custom header renderer. My solution was to create a new class which extended DataGridColumn and adds three new properties: headerToolTip, headerToolTipPosition, and headerTextTruncate (which adds the "..." if the headerText is too long to fit).
Here is the simplified version of the MXML code:
<mx:DataGrid x="10" y="10" width="500" height="130" dataProvider="{employees}">
<mx:columns>
<ui:DataGridToolTipColumn headerText="Phone" dataField="phone" width="90"
headerToolTip="Phone Number (tooltip above)" headerToolTipPosition="above"/>
</mx:columns>
</mx:DataGrid>
<mx:columns>
<ui:DataGridToolTipColumn headerText="Phone" dataField="phone" width="90"
headerToolTip="Phone Number (tooltip above)" headerToolTipPosition="above"/>
</mx:columns>
</mx:DataGrid>
The headerToolTipPosition property can have the following values:
And here is the example (right-click View Source for the full source code):
Feel free to use this code or modify it to your own needs.
** Updated on September 16th 2009