Purpose


It is necessary to create linked lists of two or more components.



Description


An example of a linked list is Countries and Cities. For example, when we select a country in the first ComboBox, and in the second linked ComboBox we can select only those cities that are present in the selected country.



To implement such a linked list, you must first create two tables in the database: Country and City.

The third table Visit is needed to record the visits of cities. Thus, the database structure will be as shown in the figure below:




Pay attention to the external key id_Country in the table City, as a rule, it is created with the option "Cascade delete", so when you delete any country from the table Country, cities belonging to the country will also be automatically removed.


Once the necessary tables in the database have been created, you can proceed to setting up components.

In the ParentComboBox property of the ComboBox that shows cities, you must select the name of the ComboBox that shows countries. Thus, the ComboBox that shows cities becomes linked.



Here you can download an example project of this linked list.