Adding a text area to a cell:
CellRow.Cells.Add(New FormattedTextArea(formattedText, 0, 0, 256, 400, style)
400 is the text area's height. How do I allow the height to get set automatically depending on the length of "formattedText"?
Auto Cell Height
Re: Auto Cell Height
Support · Feb 21, 2011Hello,
When you add the FormattedTextArea to a Cell, the height of the cell does get adjusted according to the height of the FormattedTextArea.Wwhen you add a FormattedTextArea with height 400 and not enough text to fill the height of the area then you will see some blank space in the cell when this FormattedTextArea object is added to the cell.
In order to remove the blank space, use the below code to set the height of the FormattedTextArea to fit the text and then add the FormattedTextArea to the cell.
FormattedTextArea formattedTextArea = new FormattedTextArea(s, 0, 0, 256, 400, style);
formattedTextArea.Height = formattedTextArea.GetRequiredHeight();
//GetRequiredHeight() will give you the exact height the text fills in the FormattedTextArea.
Thanks,
ceTe Software Support Team.