Register and initialize a control binding¶
This operation constructs and registers a concrete binder instance that links a single WebForms/Infragistics control to a bound business-object property (or collection, for list/grid controls). It runs once per control per page lifecycle, typically during Page_Load.
| Field | Value |
|---|---|
| Operation ID | OP-BIND-001 |
| Trigger | Page/control developer code calling one of the ~90 Add() overloads (one family per control type) on a clsObjectBindManager instance |
| Inputs | Target control instance, bound object (or IEnumerable collection for list/grid controls), key property name, optional BindTypes, optional UseEvents flag, optional control-specific args (PadArgs, CheckBoxBindingArgs, SAIFMaskEditBindingArgs, UltraGridBindingArgs, WebDataGridBindingArgs, HierarchialGridArgs, etc.) |
| Outputs | A new binder instance of the matching concrete type appended to m_Bindings; entry added/skipped in m_ValidationObjects |
| Primary components | clsObjectBindManager.Add (overload family), clsObjectBinderBase.ProcessControl, clsObjectBindManager.AddBinder |
| Entry point | SAIF.Presentation.Web.Binding.Infragistics103\clsObjectBindManager.vb |
Steps¶
- Construct the concrete binder subclass matching the control type (e.g.,
New clsTextBoxBinder). No business rule applies; no SQL/table touch. - Set
FormControl/type-specific control property, which triggersProcessControl(control)in the base/derived class, capturingm_Controlandm_ControlType(GetType().Name). - Set
BindType,UseEvents, and any padding/args properties supplied by the caller. - Call
Init()on the binder. - For event-driven, control-to-object or two-way binders,
Init()wires the control's native change event (TextChanged,SelectedIndexChanged, etc.) to an internalValueChangedHandlerthat callsControlToObject()immediately on change. - Call the private
AddBinder(binder)helper: - Compute
binder.ValidationKey(BR-BIND-006) viaIsSAIFFrameWorkObject+MyGuidreflection, or the type name uppercased. - If the key is non-empty and not already present in
m_ValidationObjects, add(key, ValidationObject). - Always append the binder to
m_Bindings. - No delegation to a referenced-library operation occurs in this sequence — all logic is local.*
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Add called]) --> Construct[Construct concrete binder subclass]
Construct --> SetControl[Set FormControl -> ProcessControl]
SetControl --> SetProps[Set BindType, UseEvents, args]
SetProps --> Init[Call Init]
Init --> Events{UseEvents true and control-to-object/two-way?}
Events -->|Yes| Wire[Wire native change event to ValueChangedHandler]
Events -->|No| Skip[No event wiring]
Wire --> AddBinder[AddBinder: compute ValidationKey]
Skip --> AddBinder
AddBinder --> Register[Register in m_ValidationObjects if new key]
Register --> Append[Append binder to m_Bindings]
Append --> EndOk([Binding registered])
Failure and edge-case behavior¶
- If
ValidationKeyresolves to an empty string (no bound object, or unable to derive a key), the object is not added tom_ValidationObjects, but the binder is still appended tom_Bindings.*
Related documentation¶
Sources¶
SAIF.Presentation.Web.Binding.Infragistics103\clsObjectBindManager.vbSAIF.Presentation.Web.Binding.Infragistics103\clsObjectBinderbase.vb