【问题标题】:How to get edited value from cxgrid lookupcombobox如何从 cxgrid lookupcombobox 获取编辑值
【发布时间】:2011-08-24 16:09:09
【问题描述】:

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

我在 cxGrid 中有一个名为 emaillist_id 的 lookupcombobox 列。其中 emaillist_id 是 KeyField,Email 是 ListField。用户可以从列表中选择电子邮件或键入新电子邮件。当用户键入 new Email 时,我想使用 SP 将其添加到数据库表中。为此,我需要获得编辑值。我该怎么做?

或者,这个问题有更好的解决方案。

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;

谢谢。

【问题讨论】:

    标签: delphi devexpress delphi-7 tcxgrid


    【解决方案1】:

    使用事件Properties.OnNewLookupDisplayText。在这里,您将 EditValue (DisplayText) 作为参数。

    【讨论】:

    • 非常感谢。你拯救了我的一天。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-17
    • 1970-01-01
    • 2022-12-06
    • 1970-01-01
    • 1970-01-01
    • 2011-10-05
    相关资源
    最近更新 更多