I am using Delphi XE2 to write a VCL win32 application. Delphi XE2 support live binding. I load sample Biolife.xml into a TClientDataSet instance.
I able to bind a TEdit control to dataset's string field: Species Name:
object BindLinkEdit11: TBindLink
Category = 'Links'
SourceMemberName = 'Species Name'
ControlComponent = Edit1
SourceComponent = BindScopeDB1
ParseExpressions = <>
FormatExpressions = <
item
ControlExpression = 'Text'
SourceExpression = 'DisplayText'
end>
ClearExpressions = <>
end
I then trying to bind Graphic field to TImage control:
object BindLinkImage11: TBindLink
Category = 'Links'
SourceMemberName = 'Graphic'
ControlComponent = Image1
SourceComponent = BindScopeDB1
ParseExpressions = <>
FormatExpressions = <
item
ControlExpression = 'Picture'
SourceExpression = 'Value'
end>
ClearExpressions = <>
end
Apparently, it doesn't work. Is that possible to do so?
Take a look into the BindLinkVCLProject
demo project. There is shown also a binding for the image, so my guess is you need to do it this way (the Self
in SourceExpression
represents a blob field):
object BindLinkImageHandler: TBindLink
Category = 'Links'
SourceMemberName = 'Graphic'
ControlComponent = Image1
SourceComponent = BindScopeDB1
ParseExpressions = <
item
ControlExpression = 'Picture'
SourceExpression = 'Self'
end>
FormatExpressions = <
item
ControlExpression = 'Picture'
SourceExpression = 'Self'
end>
ClearExpressions = <
item
ControlExpression = 'Picture'
SourceExpression = 'nil'
end>
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With