31 XE3 quick videos in 31 days - Oct27 - Using the CustomFormat property in LiveBindings

Posted by on in Blogs
Using the LiveBindings Designer and LiveBindings Wizard in RAD Studio XE3 allows you to easily link fields to UI controls and do other common LiveBindings tasks.  I wanted to bind two dataset column values (first and last name) into one TLabel in my Delphi and C++Builder demo VCL and FireMonkey applications.  I asked Jim Tierney, team member here in Scotts Valley, how to do it with LiveBindings and he showed me three ways to use an expression in the CustomFormat property of the TLinkPropertyToField component.  This quick video shows you how to use the LiveBindings Designer, LiveBindings Wizard and a custom expression.

In the video I use the sample InterBase XE3 Employee.gdb SQL database which includes a Customer table that has CONTACT_FIRST and CONTACT_LAST columns for the customer contact.  Use one of the three following expressions in the CustomFormat property of XE3's new TLinkPropertyToField to bind an expression to one UI control:

  1. A verbose version: Self.Owner.CONTACT_FIRST.Text+" "+Self.Owner.CONTACT_LAST.Text

  2. A less verbose version: %s+" "+Owner.CONTACT_LAST.Text

  3. Use this version if the field names are not valid identifiers: %s+" "+Owner.FieldByName('CONTACT_LAST').Text

Additonal information about the XE3 LiveBindings new TLinkPropertyToField component, the CustomFormat property, LiveBindings Designer and LiveBindings Wizard can be found at:

October 27 - Using binding expressions in the CustomFormat property of a TLinkPropertyToField component

Download: http://cc.embarcadero.com/item/29131

Watch on YouTube: http://www.youtube.com/watch?v=86PPmORQ7kY

Duration: 4 minutes and 23 seconds

Size: 30.4mb

Format: MP4

Thank you Jim for your help showing me how to combine two dataset columns using LiveBindings.

For additional product information go to http://www.embarcadero.com/products/rad-studio

Gold User, Rank: 1, Points: 2466
David Intersimone (known to many as David I.) is a passionate and innovative software industry veteran-often referred to as a developer icon-who extols and educates the world on Embarcadero developer tools. He shares his visions as an active member of the industry speaking circuit and is tapped as an expert source by the media. He is a long-standing champion of architects, developers and database professionals and works to ensure that their needs are folded into Embarcadero's strategic product plans. David holds a bachelor's degree in computer science from California Polytechnic State University at San Luis Obispo, California.


Check out more tips and tricks in this development video: