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¶
- Iterate
m_Bindings. Skip a binder unlessinAllControlsisTrueor that binder'sUseEventsisFalse. (BR-BIND-019) - Skip binders whose
BindTypeis notControlToObjectorTwoWay. (BR-BIND-010) - Call
Binder.ControlToObject(). clsTextBoxBinder.ControlToObjectreflects the target property's type: aStringproperty is set directly; any other type is converted withConvert.ChangeTypeinside aTrythat swallows conversion failures, leaving the property unchanged. (BR-BIND-020) (BR-BIND-021)clsCheckBoxBinder.ControlToObjectwritesTrue/Falsefor aBooleantarget or the configured checked/unchecked strings for aStringtarget. (BR-BIND-016)clsWebNumericEditBinder.ControlToObjectbranches on target type:Stringwrites the control'sText;NullableDecimalwrites an emptyNullable(Of Decimal)when the control text is empty and the control'sValueDecimalotherwise; every other target writes the Infragistics property named byNumericControlProperty. (BR-BIND-022) (BR-BIND-023)- 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) - When
UseEventsisTrue, the sameControlToObject()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.ChangeTypeis swallowed, leaving the stale property value in place rather than raising an error (BR-BIND-021).
Related documentation¶
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