Skip to content

Pull control values back into objects (control to object)

Write edited control values back onto the bound business-object properties.

Field Value
Operation ID OP-BIND-004
Trigger An explicit BindToObject() call, the first step of Validate() / RefreshValidation(), or a control change event when UseEvents is True
Inputs inAllControls flag; the bound controls' current values
Outputs Updated business object properties
Primary components clsObjectBindManager.BindToObject, each binder's ControlToObject and change-event handler
Entry point SAIF.Presentation.Web.Binding.Infragistics111/clsObjectBindManager.vb

Steps

  1. Iterate m_Bindings. Skip a binder unless inAllControls is True or that binder's UseEvents is False. (BR-BIND-019)
  2. Skip binders whose BindType is not ControlToObject or TwoWay. (BR-BIND-010)
  3. Call Binder.ControlToObject().
  4. clsTextBoxBinder.ControlToObject reflects the target property's type: a String property is set directly; any other type is converted with Convert.ChangeType inside a Try that swallows conversion failures, leaving the property unchanged. (BR-BIND-020) (BR-BIND-021)
  5. clsCheckBoxBinder.ControlToObject writes True/False for a Boolean target or the configured checked/unchecked strings for a String target. (BR-BIND-016)
  6. clsWebNumericEditBinder.ControlToObject branches on target type: String writes the control's Text; NullableDecimal writes an empty Nullable(Of Decimal) when the control text is empty and the control's ValueDecimal otherwise; every other target writes the Infragistics property named by NumericControlProperty. (BR-BIND-022) (BR-BIND-023)
  7. Grid binders (clsUltraGridBinder.ControlToObject → BindRow → UpdateObjectProperties) walk every grid row, including child rows of hierarchical bands, match each row to a business object by comparing the key property value to the key cell value, and then copy each matching column's cell value back onto the object's property. (BR-BIND-024) (BR-BIND-025)
  8. When UseEvents is True, the same ControlToObject() runs immediately from the control's change event instead of waiting for the batch call. (BR-BIND-026)

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start([BindToObject / change event]) --> S1[Iterate m_Bindings]
    S1 --> D1{inAllControls or UseEvents = False?}
    D1 -->|No| Skip[Skip binder]
    D1 -->|Yes| D2{BindType is ControlToObject or TwoWay?}
    D2 -->|No| Skip
    D2 -->|Yes| S2[Binder.ControlToObject]
    S2 --> S3[Type-specific conversion / grid row matching]
    S3 --> End([Business object property updated])

Failure and edge-case behavior

  • A conversion failure in Convert.ChangeType is swallowed, leaving the stale property value in place rather than raising an error (BR-BIND-021).

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. Statements marked with † were retrieved from dependency library documentation via the Legends CLI RAG service.

Sources

  • SAIF.Presentation.Web.Binding.Infragistics111/clsObjectBindManager.vb