DataSource

[property icon] DataSource

Specifies that variable name that is bound to a database table

Sym property

Applies to: Button , Edit , Grid , GridCell , GroupBox , KCMLEdit , Picture Button , Static Text


>DataSource

DataSource

The obsolete DataSource property contained the name of the KCML variable that has been bound to a database table. This property must be set within the Forms Designer and the variable will generally be defined previously with a DEFOBJ statement so that it appears in the Forms Designer Table List.

Controls are bound to columns within this buffer by setting their DataField property. Whenever a bound column in the row buffer is changed by KCML code in an event handler, the control in the client will be automatically updated by KCML at the end of the event. Often this is as a result of the whole row being updated by a database fetch operation. Similarly if an editable control in the client has its contents changed KCML will update the field in the row buffer when the next event (other than a Validate) is triggered.

In the case of a grid the property applies to the grid as a whole and not any cell, row or column.

The property can be inspected, but not set, at runtime with the value of the property being the SYM() of the name of the bound row buffer. THis means taht it can be inspected with SYMNAME() function.

PRINT "This control is bound to the row buffer ";SYMNAME(.editControl1.DataSource)

Starting with KCML 6.10 a new Data Binding object has been introduced which allows binding directly against DEFRECORD records and dispenses with the DEFOBJ and its schema information. This uses the alternative DataBind property on the control to specify the name of the DataBind object. If DataBind is set then DataSource is ignored. This new object is more flexible and is preferred over the original binding scheme. DataSource is now deprecated in new code and will not be supported in future versions of KCML.

See also

Button methods, properties and events. Edit methods, properties and events. Grid methods, properties and events. GridCell methods, properties and events. GroupBox methods, properties and events. KCMLEdit methods, properties and events. Picture Button methods, properties and events. Static Text methods, properties and events.