Skip to content

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

  1. Construct the concrete binder subclass matching the control type (e.g., New clsTextBoxBinder). No business rule applies; no SQL/table touch.
  2. Set FormControl/type-specific control property, which triggers ProcessControl(control) in the base/derived class, capturing m_Control and m_ControlType (GetType().Name).
  3. Set BindType, UseEvents, and any padding/args properties supplied by the caller.
  4. Call Init() on the binder.
  5. For event-driven, control-to-object or two-way binders, Init() wires the control's native change event (TextChanged, SelectedIndexChanged, etc.) to an internal ValueChangedHandler that calls ControlToObject() immediately on change.
  6. Call the private AddBinder(binder) helper:
  7. Compute binder.ValidationKey (BR-BIND-006) via IsSAIFFrameWorkObject + MyGuid reflection, or the type name uppercased.
  8. If the key is non-empty and not already present in m_ValidationObjects, add (key, ValidationObject).
  9. Always append the binder to m_Bindings.
  10. 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 ValidationKey resolves to an empty string (no bound object, or unable to derive a key), the object is not added to m_ValidationObjects, but the binder is still appended to m_Bindings.*

Sources

  • SAIF.Presentation.Web.Binding.Infragistics103\clsObjectBindManager.vb
  • SAIF.Presentation.Web.Binding.Infragistics103\clsObjectBinderbase.vb