The labelFunction on the DataGridColumn should do what you are asking.  Here is an exerpt from the docs @ http://livedocs.macromedia.com/flex/2/langref/mx/controls/dataGridClasses/DataGridColumn.html

 

labelFunction

property

 

labelFunction:Function  [read-write]

A function that determines the text to display in this column. By default the column displays the text for the field in the data that matches the column name. However, sometimes you want to display text based on more than one field in the data, or display something that does not have the format that you want. In such a case you specify a callback function using labelFunction.

For the DataGrid control, the method signature has the following form:

labelFunction(item:Object, column:DataGridColumn):String

Where item contains the DataGrid item object, and column specifies the DataGrid column.

A callback function might concatenate the firstName and lastName fields in the data, or do some custom formatting on a Date, or convert a number for the month into the string for the month.

This property can be used as the source for data binding.

Implementation
    public function get labelFunction():Function
    public function set labelFunction(value:Function):void

 

 

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Anderson
Sent: Wednesday, September 27, 2006 4:24 PM
To: [email protected]
Subject: [flexcoders] Creating calculated columns inside of DataGrid

 

Hello All,

Are there any tutorials or examples, that demonstrate Grid Columns which
possess the ability to take the contents of other Grid Columns, and
perform calculations?

The clearest example of this, would be an order form - where there would
be a Product and it's related price, and then a blank for Quantity -
then finally, the Total blank - which shows the result of the multiplied
values.

Could any of you point me in the right direction, as how to do this?

Thanks in advance,

Mike

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to