LiveBindings in VCL – Part 7 – More LiveBinding Classes

In my earlier posts on Delphi Visual Live Bindings I looked at how to link to bindings via code.

There are a number of classes that help along the way but there are two specific categories of classes and that is what I want to cover in this post.

LiveBindings and List v Link

Sometimes you want to fill a list with values; sometimes you want to keep a list of values updated; this is in essence the difference between using List (e.g. TBindList, TBindGridList) and Link (e.g. TBindListLink, TBindGridLink)

TBindList will fill a list with values, if the data/objects linked to changes then the data will not update unless you manually tell the list to re-populate using the bindings FillLists property.

TBindListLink however will keep the list in sync.

Before you continue… look at the samples

I recommend playing with the “OneOfEach” sample in the samples directory.

{samples}\LiveBindings\oneofeach\vcl

Try changing the fish name in the TBindGridLink and seeing how it updates over the other tabs where the FishFacts data is used.

What is a Binding Source and how is it different to the Control?

The LiveBindings Controls in the sample use the concept of Source and Control.

Source represents the Source of the data that is controlling the output (control).  for example, Source would be your TDataSet or TObject and then the control would be TLabel or TEdit.

Using LiveBinding Expressions

Now you understand the difference between Source and Control, there are a number of great DocWiki articles that take you over how to use the expressions (that I mention in the video).

Check out further reading in DocWiki for LiveBindings Method Examples – You may also want to try and create your own expression for use in your applications.

One very useful property where expressions are used is on the lists. Check out the “fill display custom format” as covered here.

 

3 thoughts on “LiveBindings in VCL – Part 7 – More LiveBinding Classes”

Leave a Reply

Your email address will not be published. Required fields are marked *