Question

Delphi-7, DevExpress ExpressQuantumGrid Suite For Delphi.BCB v5.8 Fianl

I have a lookupcombobox column in cxGrid named emaillist_id. Where emaillist_id is KeyField and Email is ListField. A user can either choose an email from the list or type a new one. When user type new Email I want to add it to a database table using SP. For that I need to get edited value. How can I do that?

Or maybe, there is a better solution for this problem.

procedure TfrmClientEmail.grdClientEMailDBTableViewEditValueChanged(
  Sender: TcxCustomGridTableView; AItem: TcxCustomGridTableItem);
begin
  if AItem.Index=(Sender as TcxGridDBTableView).GetColumnByFieldName('emaillist_id').Index then
   with ADOSP_ClientEmailEdit do
     begin
        Parameters.ParamValues['@KodClient']:=ADOSP_ClientEmail['KodClient'];
        Parameters.ParamValues['@email']:=Sender.Controller.EditingController.Edit.EditValue;//This return KeyFieldValue
        ExecProc();
     end;
     ADOSP_ClientEmailRefresh();
end;

Thanks.

Was it helpful?

Solution

Use the event Properties.OnNewLookupDisplayText. Here you get the EditValue (DisplayText) as parameter.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top