Hi
I have a DataGrid with 1 column - which is a custom itemRenderer.
That's built from an MXML component file containing a VBox and 3 text
boxes stacked vertically (obviously!). Each line should be displayed
without scrollbars - variableRowHeight is set to true on the datagrid.
Problem is, each line's height seems to be set to a seemingly random
value. Sometimes it works, sometimes not. I think its to do with
itemRenderer recycling, so I am trying to explicitly set the VBox
height with a dataChange event handler:
private function onDataChange():void
{
txtQuestion.validateNow();
txtOption.validateNow();
txtFeedback.validateNow();
this.height= txtQuestion.textHeight+txtOption.textHeight+
txtFeedback.textHeight;
trace ("ondatachange :" + txtQuestion.text + this.height);
}
the heights of the text fields (txtQuestion etc) don't seem to be
right so I am calling the validateNow to try to get the correct value,
but it's not happening for me?
Where am I going wrong?
Thanks for any help