MemoDropDown grid columns - 1 line inplace editor saves just the first line

When the cell is editable, and the user does not expand the memo, the content may be accidentally lost, as when the column is edited and posted without expanding, only the first line is saved.

Even if I set AutoDropDown := True , the user can collapse it and edit just the first line in the grid.

I'm using TDBAdvGrid.

Is there any way to disable the "1 line inplace editor" in a column with edMemoDropDown editor type, or force that the cell can only be edited when it's expanded?

I cannot reproduce this.
I added in DBAdvGrid ADOEditing demo in form create:

dbadvgrid1.DefaultRowHeight := 96;
dbadvgrid1.DefaultEditor := edMemoDropDown;
dbadvgrid1.MemoDropDown.AutoDrop := true;

and added for OnGetEditorType:

procedure TForm1.DBAdvGrid1GetEditorType(Sender: TObject; ACol,
ARow: Integer; var AEditor: TEditorType);
begin
case ACol of
1: AEditor := edMemoDropDown;
3, 4, 5: AEditor:= edPositiveNumeric;
6: AEditor:= edSpinEdit;
8: AEditor := edComboEdit;
end;
end;

and I cannot see an issue when editing column 1 and use multiple lines. It is always persisted here as multiple lines.

It has the same behavior.

Please see video made with modified ADOEditing demo.

No problem when editing in the "memo drop down", but if the user edits IN the cell, he loses other lines content.

My question was basically how could I make the cell kind of "read only", or blocked, so the user would only be able to edit when the memo is expanded? So he would not accidentally lose content.
It also would be ok If the cell remains editable, and the user could modify this first line without losing other lines.

Prevent this editing in the cell itself with:
grid.MemoDropDown.EditorEnabled := false;

1 Like

Great! Exactly what I needed!
Thanks!

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.