0

I need to assign a TRectangle.Fill.Color from a database field using LiveBindings, it looks like a simple thing, but I could not do it. Maybe the field type, maybe the value, but when assigned from a PrototypedBinding...it works.

How can I assign a color using livebindings?

Thank you in advanced!

  • I've had no problem binding visually `LONGWORD` field of an SQLite table I've created using FireDAC in Tokyo. Could you elaborate in details what's the exact problem, please? – Victoria Sep 29 '17 at 03:50
  • I want a TRectangle.Fill.Color change based on a value in a field from database table, so when I change the record...the color changes the TRectabgle. – FelixBCastillo Sep 29 '17 at 04:38
  • I understand. That's exactly what I was able to do. I'm asking what you're having trouble with. I've binded to persistent field through `TLinkPropertyToField`. – Victoria Sep 29 '17 at 04:48

1 Answers1

0

Here is a working example of what you need:

The field type is LongWord because System.UITypes declares TAlphaColor = type Cardinal and both Cardinal and LongWord are aliases for UInt32.

Watch the values generated by PrototypeBindSource (on the right): enter image description here

Check if the values from your database correspond to the unsigned integer values representing the required colors. Maybe you tried too small values?

And here is a pattern of bindings for the given form: enter image description here

asd-tm
  • 3,381
  • 2
  • 24
  • 41