Posted 24 February 2019, 5:54 am EST
Hi …
is there any way to Resize a multiline-Field in Editmode after the users enters a new line ?
Regards,michael
Forums Home / Spread / Spread for WinForms
Posted by: michael on 24 February 2019, 5:54 am EST
Posted 24 February 2019, 5:54 am EST
Hi …
is there any way to Resize a multiline-Field in Editmode after the users enters a new line ?
Regards,michael
Posted 25 February 2019, 7:26 am EST
Hello,
You may get Row’s height with GetPreferredHeight method and set it for the Row on Leave Cell event. It should work when you have MultiLine and WordWrap set to True for a cell/ column.
Please have a look at code and attached sample for the same.
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim g As New FarPoint.Win.Spread.CellType.TextCellType
g.Multiline = True
g.WordWrap = True
FpSpread1.Sheets(0).Columns(1).CellType = g
End Sub
Private Sub FpSpread1_LeaveCell(sender As Object, e As LeaveCellEventArgs) Handles FpSpread1.LeaveCell
FpSpread1.ActiveSheet.Rows(e.Row).Height = FpSpread1.Sheets(0).Rows(e.Row).GetPreferredHeight
End Sub
Hope it helps.
Thanks,
Reeva
ResizeRowHeightAtRunTime.zip
Posted 5 March 2019, 1:35 am EST
Hello,
thanks for your help - magically now it seems to be working
in editing mode the .Multiline is the magic key Right ?
Regards,
michael
Posted 5 March 2019, 1:51 am EST
Hello,
Yes, you have to set the celltype’s multi-line property to true for the same.
Thanks,
Reeva