Declaring the Access Properties for a Data-aware Control

From RAD Studio
Jump to: navigation, search

Go Up to Adding the Data Link


Every data-aware control has a DataSource property that specifies which data source class in the application provides the data to the control. In addition, a control that accesses a single field needs a DataField property to specify that field in the data source.

Unlike the access properties for the owned classes in the example in Creating a graphic component these access properties do not provide access to the owned classes themselves, but rather to corresponding properties in the owned class. That is, you will create properties that enable the control and its data link to share the same data source and field.

Declare the DataSource and DataField properties and their implementation methods, then write the methods as "pass-through" methods to the corresponding properties of the data link class.

See Also