【问题标题】:Delphi Livebindings - Including other field values in CustomFormatDelphi Livebindings - 在 CustomFormat 中包含其他字段值
【发布时间】:2014-08-22 22:48:50
【问题描述】:

这应该很简单,但我似乎很难让它发挥作用。

很简单,我有一个 name 列和一个 id (autoinc) 列,我想使用 Live Bindings 将这两个字段组合成一个标签控件。

我已将自定义控件设置为

“%s (Self.Owner.FieldByName('ind_id').Text)”

但无济于事,我只是说“名称 0”是 0 应该是字段 ID 值。

知道我做错了什么吗!?

提前致谢。

【问题讨论】:

  • 您总是可以使用计算字段来组合 2 个字段
  • 你试过没有Owner:%s (Self.FieldByName('ind_id').Text)吗?
  • 没有所有者只会导致 'FieldByName' not found 错误。计算字段似乎有点 OTT,虽然它可以工作,但我认为 LiveBindings 应该很容易做到这一点。

标签: delphi livebindings


【解决方案1】:

试试这个:Self.DataSet.FieldByName('ind_id').Text

【讨论】:

    猜你喜欢
    • 2017-07-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-29
    • 2014-10-29
    • 2021-11-21
    相关资源
    最近更新 更多