newColumn.headerRenderer = new ClassFactory(myHeaderRenderer);
MXMLC generates this code for you when you say headerRenderer="myHeaderRenderer" in MXML. ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Mark McCray Sent: Monday, March 19, 2007 9:06 AM To: [email protected] Subject: [flexcoders] programmatically adding a new column to the datagrid Hey there, I'm adding columns to the "columns" array for a datagrid without any difficulty. Except for when i try to specify the Header Renderer. We're building a new column object by writing AS code like : newColumn.dataField = columnObj.dataField; newColumn.wordWrap = columnObj.wordWrap; And we push! this onto the columns array and that works fine. But how do i say that i want the header renderer for the new column to be the one that's defined in "cmpHeader.mxml" in the current directory? Things like th! e following don't work: var myHeaderRenderer:DataGridItemRenderer = new DataGridItemRenderer(cmpHeader.mxml); newColumn.headerRenderer = myHeaderRenderer; -- or -- newColumn.headerRenderer = "cmpheader.mxml"; -- or -- newColumn.headerRenderer = cmpHeader; Thanks! marky!

