WaldoSmeets.com gave very nice example to add a calculated column to a datagrad as flex example.

Look at Example