LiveBindings.BindLinkVCL Sample

From RAD Studio Code Examples
Jump to: navigation, search

This sample project demonstrates the use of a TBindLink.

Location

You can find the BindLinkVCL sample project at:

  • Start | Programs | Embarcadero RAD Studio Sydney | Samples and then navigate to Object Pascal\LiveBindings\bindlink\vcl
  • Subversion Repository:
    • You can find Delphi code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version.

Description

This sample demonstrates the use of a TBindLink. This sample uses LiveBindings to bind a TDBNavigator with other controls.

How to Use the Sample

  1. Navigate to Start | Programs | Embarcadero RAD Studio Sydney | Samples, go to Object Pascal\LiveBindings\bindlink\vcl and open BindLinkVCLProject.dproj.
  2. Press F9 or choose Run > Run.
  3. When you run the application, the main window displays the visual components of the sample. Initially, the components display the first item of the dataset.
  4. Ensure the Active TCheckBox is checked to use the sample.
  5. Use the TDBNavigator to navigate through the dataset.
  6. See how the rest of the visual components update when navigating thought the dataset.
  7. Choose View > LiveBindings Designer to open the LiveBindings Designer and view the data binding connections.

Files

File Contains

BindLinkVCLProject

The project itself.

BindLinkVCLFormUnit1

The main form where the components are located.

Readme.html

Basic information about this sample.

Implementation

  • Use the DBNavigator1 TDBNavigator to navigate through the dataset.
  • TBindingsList is used to create managed binding among the different components. TBindLink is used to create bindings to the columns of the dataset.
  • The ImageWithHander TImage displays the Graphic Field of the selected fish within the dataset.
  • The EditWithHandler TEdit displays the Category Field of the selected fish within the dataset.
  • The MaskEditWithHandler TMaskEdit displays the Category Field of the selected fish within the dataset.
  • The ListBoxWithHandler TListBox displays the different Categories of the dataset.
  • The MemoWithHandler TMemo displays the Notes Field of the selected fish.
  • The LabelBind TLabel displays the Category, and Species Name of the selected fish. The LabelPosition TLabel displays the position of the selected fish within the dataset. The information these two TLabels display is defined in the Binding Expression Editor.
  • The CheckBoxDatasetActive TCheckBox enables or disables the TDataSource.

Uses

See Also