Here is the piece of code you can use textarea for datagrid as itemrenderer. Based on the requirement it will show scrollbar otherwise it will adjust height automatically.
xmlns:mx="library://ns.adobe.com/flex/mx"
focusEnabled="true" xmlns:local="*">
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
{
super.updateDisplayList(unscaledWidth,unscaledHeight);
callLater(assignHeight);
}
public function assignHeight():void
{
if(txtAutosize.textDisplay)
{
if(txtAutosize.textDisplay.textFlow.flowComposer.numLines <=2)
{
txtAutosize.heightInLines=txtAutosize.textDisplay.textFlow.flowComposer.numLines;
}else
{
txtAutosize.heightInLines=3;
}
}
}
]]>
