C1Input controls can function both in unbound and in bound mode. In bound mode, a control’s Value is bound to a data source field.
C1Input controls support data binding to all .NET data sources. This includes ADO.NET data source objects such as DataTable, DataView and DataSet, and also DataObjects components such as C1ExpressTable, C1ExpressView, C1ExpressConnection, C1DataView, C1DataTableSource and C1DataSet.
For details about creating ADO.NET data source objects, please refer to the .NET Framework documentation.
For details about using DataObjects, see the C1DataObjects documentation included in the ComponentOne Studio Enterprise. DataObjects is a data framework, a part of ComponentOne Studio Enterprise, enhancing ADO.NET in many ways.
To bind a C1Input control to a date source field:
You can set the DataSource and DataField properties in code as well as in the designer. At design time, you can select the data source object and its field from the lists of available data sources and their fields provided by the DataSource/DataField property combo boxes.
After you bind the control to a data field, the DataType property is automatically set to the data type of the field it is bound to. In most cases, this setting is what you need. However, sometimes you need different types for the control and the field. For example, you might have a string field containing dates. In such cases, you can set the DataType property after binding and use the BindingFormatting/BindingParsing events to convert data to/from the control’s DataType when it is written from/saved to the data source.
The DataSource/DataField properties are used to bind the Value property of the control to a data source field. The Value property is the main property of a C1Input control. It holds and returns a value with of a specific data type. In addition, you have the freedom to bind other properties of the control to other data sources and fields, as in any other WinForms control, using the DataBindings property. This functionality is not C1Input-specific; it is supported by the .NET Framework for all controls.