The question implies the necessity of a custom data-bound control. When creating a custom data-bound control, the data-binding abilities must be implemented. DataBoundControl, GetData(), DataSourceView, and GetDataSource() are a few methods and classes involved in custom data-bound controls.
DataBoundControl is the base class used to implement custom data-bound controls. It contains
methods such as
GetData() and
GetDataSource() to help with the data-binding implementation of the custom control.
A data-bound control by definition will need to bind to data. There is one important question to answer regarding data: What is the data? Is it a file? Is it a table in a database? If it is a file, what format is it in: CSV, XML, text, pdf? Is it a collection of related data or a single piece? Knowing what the raw data is; its structure; its format; is essential to be able to use it as the underlying data for the data source of the custom control.
A data-bound control will need a data source. The data source is generally set by the user of the control. The data source can be such things as files and database entities as previously implied. When working with binding in the custom control the data is accessed by calling GetData(). The GetData method calls GetDataSource() internally. Calling these methods retrieves an
IDataSource instance that is cached by the DataBoundControl object. This instance will remain until the
OnDataPropertyChanged method signals that the data source has changed.
Specifically, GetData() returns a
DataSourceView. The DataSourceView is a base class and is used by the control for data operations. Creating a custom data-bound control will probably involve creating a custom DataSourceView. A DataSourceView provides create, read, update, and delete (CRUD) operations for working with the underlying raw data. The corresponding methods are: Insert, Select, Update, and Delete. In a way, the DataSourceView provides the structure of the data for the data-bound control. Therefore, there are three representations of the raw-data: the raw-data structure itself (XML, database table), the DataSourceView (the structure to provide to the control), and the data-bound control (the way the control presents the data to the user).
NOTE: Please view the links provided above for example usage of the corresponding topic (Most notably,
DataBoundControl)