With simple data binding, you can bind a property of your ActiveX control to a field in a database. To do this, the ActiveX control must communicate with its host application about what value represents field data and when it changes. You enable this communication by setting the property's binding flags using the Type Library editor.
By marking a property bindable, when a user modifies the property (such as a field in a database), the control notifies its container (the client host application) that the value has changed and requests that the database record be updated. The container interacts with the database and then notifies the control whether it succeeded or failed to update the record.
Binding attribute |
Description |
Bindable |
Indicates that the property supports data binding. If marked bindable, the property notifies its container when the property value has changed. |
Request Edit |
Indicates that the property supports the OnRequestEdit notification. This allows the control to ask the container if its value can be edited by the user. |
Display Bindable |
Indicates that the container can show users that this property is bindable. |
Default Bindable |
Indicates the single, bindable property that best represents the object. Properties that have the default bind attribute must also have the bindable attribute. Cannot be specified on more than one property in a dispinterface. |
Immediate Bindable |
Allows individual bindable properties on a form to specify this behavior. When this bit is set, all changes will be notified. The bindable and request edit attribute bits need to be set for this new bit to have an effect. |
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|