I've found myself in a position where I need to dynamically add content to the
headerRenderer of a datagrid depending on the column header. As a simple
example, assuming my datagrid is called myDG and the headerRenderer is a file
called myHeader.mxml:

var newTerm:String = myDG.getColumnAt(myVar).headerText.toString();
if(newTerm == 'theColumn') {
myDG.getColumnAt(myVar).headerRenderer = myHeader(myVar);
}
else {
myDG.getColumnAt(myX).headerRenderer = myHeader;
}

Obviously the syntax is wrong in myHeader(myVar) but thats basically what I'm
looking to do: pass that value over to the headerRenderer so I can use it to
create content to be displayed in the column header.

Any help would be appreciated.