This content has been marked as final. Show 3 replies
Is DragHeader a component?
"texas_stingray" <firstname.lastname@example.org> wrote in message
>I an dynamicly adding columns to a datagrid and I also need to set the
> headerRenderer. I have a MXML component call DragHeader. When I set the
> dataGridColumn dgc.headerRenderer = DragHeader it is not being set. If I
> the headerRenderer in a MXML componenet directly <mx:dataGridColumn ....
> headerRenderer="DragHeader" /> it work as designed. Can anyone help me
> some action script to set it.
When you set renderers in ActionScript, you need to use a ClassFactory of
the class instead of just the class. When you set a renderer in MXML, the
wrapping just happens for you.
Here's an example from one of my projects, that uses a class factory to set the legendMarkerRenderer. Uou should be able to use a similar approach on your headerRenderer.
public var cf:ClassFactory
cf = new ClassFactory(CircleItemRenderer);