Using getComboEdit as a column Editor does not allow you to type a text that is not in EditorItems. It leaves the cell blank.
To reproduce: take the VCL/DataGrid/Basic/Editing demo, and replace getComboBox by getComboEdit. It won’t allow you to type a text that is not in the list.
Shouldn’t it allow one to type a text that is not in Items list ? I thought this control was for that: offer a pre loaded list of options, but letting the user type whatever he wants, otherwise there’s no additional benefit using the edit box.
Hi,
There is code that automatically detects properties via RTTI, in comboedit it detects ItemIndex & Items, which are then linked and accepted. Since the Text property is not used, it ignores this. You can overcome this via the following event:
procedure TForm1.TMSFNCDataGrid1BeforeInplaceEditorGetValue(Sender: TObject;
ACell: TTMSFNCDataGridCellCoord; AInplaceEditor: TTMSFNCDataGridInplaceEditor;
var AValue: TTMSFNCDataGridCellValue; var AHandled: Boolean);
begin
AValue := GetObjectValue(AInplaceEditor, 'Text');
AHandled := True;
end;
except, we noticed a bug in the event handler, you will need to set AHandled to False instead of True, next version of TMS FNC UI Pack will address this.
Thanks !
BTW, “GetObjectValue” is an interesting (and usefull) disclosure! ![]()
Great idea, but with a very weird default property precedence order inside. ![]()