Stack Overflow sign up log in
Questions Jobs Tags Users Badges Ask
7 How to use live binding to bind blob field to TImage control?
delphi delphi-xe2 livebindings
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?
share improve this question follow
Chau Chee Yang asked
14.5k ● 11 ● 56 ● 120 May 14 '12 at 7:09
edited
May 14 '12 at 8:05
By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our
Terms of Service.
1 Answer order by votes
Take a look into the BindLinkVCLProject demo project. There is shown also a binding for the
7 image, so my guess is you need to do it this way (the Self in SourceExpression represents a blob
field):
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
share improve this answer follow
TLama answered
69k ● 15 ● 178 ● 331 May 14 '12 at 8:18
edited
May 14 '12 at 8:23
Your Answer
Body
By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our
Terms of Service.
Add picture
Log in
OR
Name
Email
By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy
Post Your Answer
meta chat tour help blog privacy policy legal contact us full site
2020 Stack Exchange, Inc. user contributions under cc by-sa 4.0
By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our
Terms of Service.