Well I think that I got this working...sort of...thought that I would pass my solution on for others that might use it.
Basically I retrieve a public variable dictionary from the parentApplication which contains the properties that I need. The public dictionary uses the datafield for the column as key. Example: Creating the properties in the main application... dgCol.headerRenderer = new ClassFactory(HeaderDefinition); headerDefinitionProperties.Message[dgCol.dataField] = "Hello" + dgCol.dataField; Accessing the propertiy from the headerrenderer... message = this.parentApplication.headerDefinitionProperties.Message [data.dataField]; I created a class HeaderDefinitionProperties to hopefully keep the properties a little more standardized.... So what do you think. I do not exactly like accessing a public property via the parentApplication but I do not see any other way to do this....Anyone have any other ideas?? Thanks in advance for the thoughts.... -Torey --- In [email protected], "Torey Maerz" <[EMAIL PROTECTED]> wrote: > > How could I pass a value into a headerrenderer so that I can use that > value to perform a specific action in the renderer? > > For example here is my renderer: > > <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"> > <mx:Label text="Hello"/> > <mx:Image height="20" source="info.gif" click="Alert.show ('Hello > World!', 'Message')"/> > <mx:Script> > <![CDATA[ > import mx.controls.Alert; > ]]> > </mx:Script> > </mx:HBox> > > I would like to display something other than hello world for the > alert or even pass multiple variables in to determine how the > renderer will be created. For example something to determine which > icon to show. > > Here is my code that dynamically creates the columns: > > private function LoadColumns(event:ResultEvent):void > { > //Creating an array from an httpservice > var cols:Array = ArrayUtil.toArray > (columns.lastResult.Columns.Column); > var newCols:ArrayCollection = new ArrayCollection(); > > //Looping through the columns and setting the properties > var count:int = cols.length; > for(var x:int = 0; x < count; x++) > { > var dgCol:DataGridColumn = new DataGridColumn(cols[x].Heading); > dgCol.dataField = "Data" + x.toString(); > > dgCol.headerRenderer = new ClassFactory(HeaderDefinition); > //OK Here I would like to set the properties > //dgCol.headerRenderer.someProperty = someValue > > newCols.addItem(dgCol); > } > > dg.columns = newCols.toArray(); > > //Send the httpservice that contains the data for these columns > data.send(); > } > > What do I need to do to pass a couple variables into the > headerRenderer?? > > Thanks in advance for any help!!! > > </Torey> > ------------------------ Yahoo! Groups Sponsor --------------------~--> Something is new at Yahoo! Groups. Check out the enhanced email design. http://us.click.yahoo.com/SISQkA/gOaOAA/yQLSAA/nhFolB/TM --------------------------------------------------------------------~-> -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

