Page 1 of 1

How to prevent a user entering more text then fits the cell

Posted: Tue Apr 22, 2014 5:39 pm
by Frederik
Hi,

The cells in a table must keep their originally assigned size. To prevent the cells from re-sizing when the input text exceeds the visible cell space the table.options include [rvtoIgnoreContentWidth, rvtoIgnoreContentHeight, ...].
It prevents cell re-sizing but the user can still type in more text then fits the cell. How can I prevent users from entering more text then fits the visible cell area or at least give them a warning when they do?

Is there a way to calculate the "formatted" texheight from a cell so it can be compared to the cellheight. GetItemtext methods only seem to return "raw" text strings.

thanks in advance

Posted: Wed Apr 23, 2014 5:42 pm
by Sergey Tkachenko
The only suggestion I can make is checking Cell.GetRVData.DocumentHeight in OnChange event, and calling Undo if it is too large.

Posted: Wed Apr 23, 2014 6:39 pm
by Frederik
Hi Sergey,

The cell.documentheight somehow always returns 0 ... however, the documentheight of the TopLevelEditor does return the actual formatted textheight. When the input text "overfills" the cell the TopLevelEditor.DocumentHeight gets higher then the Cell.BestHeight. Bingo!

Thanks!