0
votes

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!

1
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
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
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

1 Answers

0
votes

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