All, I have implemented a HeaderRenderer on all my Datagrid columns. When I do this, it appears that all the default DataGrid column header styles are being lost, eg:
- When I hover over a column header, the default in the DataGrid is to show it in another colour (same colour as the row selection colour) - this is not happening now.
- When I click on a column header, the default in the DataGrid is to show it in another colour (same colour as the row selection colour) - this is not happening now.
Do I have re-apply these styles in my s:MXDataGridItemRenderer ? How is this done...
My renderer code is below...
<s:MXDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
focusEnabled="true">
<s:states>
<s:State name="none" />
<s:State name="asc" />
<s:State name="desc" />
</s:states>
<!-- border - bottom -->
<s:Rect bottom="0" right="0" left="0" height="1">
<s:fill>
<s:SolidColor color="0x9C9C9C" />
</s:fill>
</s:Rect>
<!-- border - top -->
<s:Rect top="0" right="0" left="0" height="1">
<s:fill>
<s:SolidColor color="0x9C9C9C" />
</s:fill>
</s:Rect>
<s:HGroup verticalAlign="middle" width="100%">
<s:HGroup horizontalAlign="left" width="100%" paddingLeft="5">
<s:Label id="lblData" width="100%"
top="0" left="5" right="0" bottom="0"
paddingTop="5" paddingBottom="5"
verticalAlign="middle"
color="black"
text="{dataGridListData.label}"
maxDisplayedLines="1"
/>
</s:HGroup>
<s:HGroup horizontalAlign="right" verticalAlign="middle" paddingRight="2" >
<s:Label id="lblcolCount"
top="0" left="0" right="0" bottom="0"
paddingTop="5" paddingBottom="5"
verticalAlign="middle"
color="black"
text="{colCount}" />
<mx:Image id="image_down" top="0" left="0" bottom="0"
source.asc="{GridColumnSortControlAscending}" verticalAlign="middle"
source.desc="{GridColumnSortControlDecending}"/>
</s:HGroup>
</s:HGroup>
<fx:Script>
<![CDATA[
[Bindable]
public var colCount:String = "";
]]>
</fx:Script>