Skip to content

Re-point a binder at a new data source

Rebind an existing grid or drop-down control to a new collection after a postback, without re-registering it through Add.

Field Value
Operation ID OP-BIND-008
Trigger Application replaces a grid's or drop-down's collection after a postback
Inputs The control instance and the new data source
Outputs The binder's bind source replaced and the control rebound
Primary components clsObjectBindManager.Update (three overloads for UltraWebGrid, WebDataGrid, DropDownList)
Entry point SAIF.Presentation.Web.Binding.Infragistics111/clsObjectBindManager.vb

Steps

  1. Scan m_Bindings for a binder whose runtime type name matches the expected binder class (clsUltraGridBinder, clsWebDataGridBinder, clsDDLBinder). (BR-BIND-055)
  2. Skip binders whose BindType is not ObjectToControl or TwoWay. (BR-BIND-010)
  3. Match the binder to the control by comparing FormControlID and the control's UniqueID, case-insensitively. (BR-BIND-056)
  4. Assign the new data source to Binder.BindSource and flag an update.
  5. If an update was flagged, call AddBinder(Binder) and then Binder.ObjectToControl(). (BR-BIND-057)

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start([Application calls Update]) --> S1[Scan m_Bindings by binder class name]
    S1 --> D1{BindType is ObjectToControl or TwoWay?}
    D1 -->|No| Skip[Skip binder]
    D1 -->|Yes| S2[Match FormControlID to control UniqueID]
    S2 --> D2{Match found?}
    D2 -->|No| Skip
    D2 -->|Yes| S3[Assign new BindSource]
    S3 --> S4[AddBinder again]
    S4 --> S5[Binder.ObjectToControl]
    S5 --> End([Control shows new data source])

Failure and edge-case behavior

  • Step 5 calls AddBinder on an already-registered binder, so Update appends a duplicate entry to m_Bindings on every call — repeated updates grow the binder collection and cause the same binder to be validated multiple times.*

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