我正在使用 Delphi XE2 编写 VCL win32 应用程序。Delphi XE2 支持实时绑定。我将示例 Biolife.xml 加载到 TClientDataSet 实例中。
我能够将 TEdit 控件绑定到数据集的字符串字段:物种名称:
object BindLinkEdit11: TBindLink
Category = 'Links'
SourceMemberName = 'Species Name'
ControlComponent = Edit1
SourceComponent = BindScopeDB1
ParseExpressions = <>
FormatExpressions = <
item
ControlExpression = 'Text'
SourceExpression = 'DisplayText'
end>
ClearExpressions = <>
end
然后我尝试将图形字段绑定到 TImage 控件:
object BindLinkImage11: TBindLink
Category = 'Links'
SourceMemberName = 'Graphic'
ControlComponent = Image1
SourceComponent = BindScopeDB1
ParseExpressions = <>
FormatExpressions = <
item
ControlExpression = 'Picture'
SourceExpression = 'Value'
end>
ClearExpressions = <>
end
显然,它不起作用。有可能这样做吗?