Skip to content

Push object values into controls (object to control)

Populate bound controls from the current business-object property values.

Field Value
Operation ID OP-BIND-003
Trigger binder.DataBind() explicit call, or automatically on PreRender when AutoBind is True
Inputs Registered binders and their bind sources
Outputs Controls populated with business object values
Primary components clsObjectBindManager.DataBind, clsObjectBindManager.OnPreRender, each binder's ObjectToControl
Entry point SAIF.Presentation.Web.Binding.Infragistics111/clsObjectBindManager.vb

Steps

  1. Iterate m_Bindings and skip any binder whose BindType is not ObjectToControl or TwoWay. (BR-BIND-010)
  2. Call Binder.ObjectToControl().
  3. Simple-value binders read the property via GetObjectValueAsString (using TypeDescriptor/PropertyDescriptor and the property's TypeConverter) and assign it to the control's text/value property; a Nothing bind source is skipped. (BR-BIND-011) (BR-BIND-012)
  4. When padding is configured, the retrieved string is left- or right-padded to the configured length with the configured character before it reaches the control. (BR-BIND-013)
  5. Typed binders branch on their configured target type. clsWebNumericEditBinder selects the Infragistics property named by NumericControlProperty (Text, Value, ValueByte, ValueDecimal, ValueDouble, ValueFloat, ValueInt, ValueLong, ValueShort); when the target type is NullableDecimal and the object value is Nothing, it writes Double.NaN to the control. (BR-BIND-014) (BR-BIND-015)
  6. clsCheckBoxBinder sets Checked from CBool(value) for a Boolean target, or by case-insensitively comparing the value to the configured checked string for a String target. (BR-BIND-016)
  7. Grid binders assign the collection to the grid's DataSource and call the grid's DataBind(). (BR-BIND-017)
  8. clsCustomValidator.ObjectToControl is a no-op returning True.
  9. OnPreRender runs DataBind() when AutoBind is True, then SaveStateValues writes AutoBind into ViewState. (BR-BIND-018)

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start([DataBind / PreRender AutoBind]) --> S1[Iterate m_Bindings]
    S1 --> D{BindType is ObjectToControl or TwoWay?}
    D -->|No| Skip[Skip binder]
    D -->|Yes| S2[Binder.ObjectToControl]
    S2 --> S3{Bind source Nothing?}
    S3 -->|Yes| Skip
    S3 -->|No| S4[Read value via GetObjectValueAsString / typed branch]
    S4 --> S5[Apply padding if configured]
    S5 --> S6[Write value to control]
    S6 --> End([Control shows object value])

Failure and edge-case behavior

  • A binder bound to a Nothing object is skipped so the page still renders (BR-BIND-011).

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