Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

Quickly Bind Your Data Source To Different Types Of Data With LiveBindings Delphi AdapterBindSource Sample App

LiveBindings help Delphi/C++ developers to connect source and control component with no lines of code. Connecting to the Datasource or TPrototypeBindSource is straightforward way to connect to your controls. How about binding the custom data collections created for your application with your control components? No Idea ? Don’t worry. This post can guide you to do the job smoothly. TAdapterBindsource which supports adapters to connect to different types of data.

AdapterBindSource sample shows using the TAdapterBindSource to create a bidirectional binding between a generic TObjectList of user defined objects and a grid.

You can find Delphi code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version.

Components used in the Sample App:

The grid and the adapters are linked using LiveBindings.

Implementation details :

Design Time:

Run Time : At run time, the TDataGeneratorAdapter is replaced with the user-defined data.

JSON Data : The sample uses the OnChange event from the TTabControl to populate the TMemo from the JSON tab with the JSON representation of the data from the grid. Making changes on the Grid data, updates the data from the JSON tab, and vice versa. Check out the full article in the DocWiki about the LiveBindings.AdapterBindSource Sample.

<strong>AdapterBindSource Sample App<strong>

Check out the full source code for the AdapterBindSource projects for Delphi and C++Builder over on GitHub.

Exit mobile version