Skip to content

Bind a control to its model value

This operation reads the current value of the model property named by BindSource/BindProperty and copies it into the control's own Value property, then optionally validates the control.

Field Value
Operation ID OP-AJAX-02
Trigger ASP.NET data-binding phase, or an explicit DataBind call
Inputs RootBindingObject, BindSource, BindProperty
Outputs Control's Value property populated; optional validation run
Primary components AutoBindControlAncestor.DataBind, BindToControl
Entry point SAIF.Presentation.Web.Controls.AJAX.Infragistics111/AutoBindControlAncestor.vb

Steps

  1. Call MyBase.DataBind().
  2. If RootBindingObject is Nothing, return without binding. (BR-AJAX-003)
  3. On this condition, the control renders its design-time value unchanged.
  4. BindToControl resolves BoundObject by walking the dotted BindSource path from the root object, then copies BoundObject.<BindProperty> into this control's Value property. (BR-AJAX-004)
  5. On reflection failure: the exception is caught and ignored, leaving Value unchanged.*
  6. If AutoValidateOnDataBind is set (default True), run Validate(). (BR-AJAX-006)

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start([DataBind triggered]) --> Base[MyBase.DataBind]
    Base --> Root{RootBindingObject<br>set?}
    Root -->|No| EndUnbound([Render design value])
    Root -->|Yes| Resolve[Resolve BoundObject via BindSource path]
    Resolve --> Copy[Copy BoundObject.BindProperty into Value]
    Copy --> AutoValidate{AutoValidateOnDataBind?}
    AutoValidate -->|Yes| Validate[Run Validate]
    AutoValidate -->|No| EndBound([Value populated])
    Validate --> EndBound

Failure and edge-case behavior

  • Reflection failures during path resolution or property access are swallowed by BindingUtility; the control's Value simply remains unchanged.*

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • SAIF.Presentation.Web.Controls.AJAX.Infragistics111/AutoBindControlAncestor.vb
  • SAIF.Presentation.Web.Controls.AJAX.Infragistics111/BindingUtility.vb