Reputation: 11
I'm using Delphi 11 Enterprise.
I am trying to display multiple fields from a TClientDataSet in a TMemo field using livebinding. I have linked one field to the TMemo using the Wizard in the Visual Binder. That works fine.
I then inspect the TMemo component, and drill down through LiveBindings / LinkControlToField / CustomFormat.
If I change this to - say - UpperCase(%s) then I get the correct result: i.e. the TMemo's value is changed to upper case. However, I try to access any other field in the TClientDataSet - using Self.Owner.FieldByName(fieldName).Text, I get a blank result. If I try %s+" "+Self.Owner.FieldByName(fieldName).Text the answer I get is the original field with a 0 after it, e.g: "Smith, John 0"
I've tried linking the TMemo to the TClientDataSet's field using "Link a component Property with a control" and also "Link a control with a field". I've used both of those Binding Tasks in the Livebindings Wizard. They both give me the same result.
I have the data access controls - TDataSet / TProvider / TClientDataSet / TDataSource in a DataModule. I tried copying them into the form that has the TMemo, in case that might help. But I had the same result.
The only examples I've seen of livebinding and CustomFormat have been using FireDAC components. I'm using DBExpress. Could this be an issue?
Thanks for any advice!
Adam
Upvotes: 1
Views: 76