Hello,
what differs this editor type from type etEdit? When or for what should I use this?
When setting a column WordWrap:= true, how can I edit multiline cell content?
Thank you and with best regards
Hi,
The difference is that you can use CTRL+ENTER to add multiple lines before using ENTER to confirm changes. CTRL+ENTER doesn't work on TEdit. If you add for example
TMSFNCGrid1.Cells[1, 1] := 'Line1'#13#10'Line2';
This will display as 2 separate lines in TMemo.
CTRL+ENTER seems not working under Lazarus + qt widgets, but working with gtk2. Is it possible to adjust the row height of the current row to show all text lines ?
Hi,
You can use AutoSizeRow or manually set the row height with the Grid.RowHeights property
Hello,
what is the correct moment to adjust the row height for a cell editor which needs a more higher row height? When I try to set it in OnGetCellEditorProperties, the new height is set after moving to the next cell. When to reset to the default row height? In OnCellEditDone ?
Hi,
The following code demonstrates this
procedure TForm1.TMSFNCGrid1CellEditDone(Sender: TObject; ACol, ARow: Integer;
CellEditor: TControl);
begin
if CellEditor is TMemo then
begin
TMSFNCGrid1.RowHeights[ARow] := TMSFNCGrid1.DefaultRowHeight;
TMSFNCGrid1.UpdateGridCells;
end;
end;
procedure TForm1.TMSFNCGrid1GetCellEditorProperties(Sender: TObject; ACol,
ARow: Integer; CellEditor: TControl);
begin
if CellEditor is TMemo then
begin
TMSFNCGrid1.RowHeights[ARow] := 100;
TMSFNCGrid1.UpdateGridCells;
end;
end;
Pieter Scheldeman2016-06-07 12:24:09
Thank you, its working. The UpdateGridCells() method made it