---
title: Auto-bind an individual control to its bound object
summary: Reads a bound property into a control's Value and writes edits back to the bound object.
status: draft
owner: SAIF documentation generator
last_reviewed: 2026-08-17
library: SAIF.Presentation.Web.Controls.AJAX.Infragistics103
reference_type: package
operation_id: OP-AJAX-002
trigger: ASP.NET control lifecycle calls DataBind() on the control (directly or via BindingManager), or user postback
---

# Auto-bind an individual control to its bound object

`AutoBindControlAncestor.DataBind()`/`BindToControl()`/`BindToObject()` implement the reflection-based binding contract shared by `AutoBindTextbox`, `AutoBindWebDateTimeEdit`, and `AutoBindWebMaskEdit`. The control resolves its bound business-object property via a dotted-path lookup (`BindSource`), pushes the value into its own `Value` property, and — on user postback — writes edits back onto the bound object.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-AJAX-002 |
| **Trigger** | ASP.NET control lifecycle calling `DataBind()` on the control (directly, or via [Page-wide auto-bind and validate](page-wide-auto-bind-and-validate.md)); or a user postback event (`TextChanged`/`ValueChange`) |
| **Inputs** | `RootBindingObject`, `BindSource` (dotted property path, e.g. `"Submission.Locations.Primary"`), `BindProperty` |
| **Outputs** | Control's `Value` populated from the bound business-object property; on postback, the bound object's property is updated |
| **Primary components** | `AutoBindControlAncestor.DataBind`, `AutoBindControlAncestor.BindToControl`, `AutoBindControlAncestor.BindToObject`, `BindingUtility.GetObject`, `BindingUtility.BindValue` |
| **Entry point** | `SAIF.Presentation.Web.Controls.AJAX.Infragistics103\AutoBindControlAncestor.vb` |

## Steps

1. `MyBase.DataBind()` runs standard `CompositeControl` data binding.
2. If `RootBindingObject` is `Nothing`, the method returns immediately — binding silently no-ops.
3. `BindToControl()` is called: `BindingUtility.BindValue(BoundObject, BindProperty, Me, "Value")` reads the named property off the resolved `BoundObject` (itself resolved via `BindingUtility.GetObject(RootBindingObject, BindSource)`, a dotted-path traversal) and pushes it into the control's `Value` property via reflection (`PropertyInfo.SetValue`).
4. If `AutoValidateOnDataBind` is `True` (default), [Validate a bound control and reflect state](validate-a-bound-control-and-reflect-state.md) is invoked.
5. Concrete subclasses (e.g., `AutoBindTextbox.LayoutControls`) subsequently push `Value` into the underlying HTML/Infragistics editor control (`m_Textbox.Text = CStr(Value)`, etc.) at render time.
6. On user postback (`Textbox_TextChanged`/equivalent `ValueChange` handlers), the control's `Value` is updated from the editor, then `BindToObject()` is called: `BindingUtility.BindValue(Me, "Value", BoundObject, BindProperty)` writes the new value back onto the bound business object.
   - If `AutoValidate` is `True`, [Validate a bound control and reflect state](validate-a-bound-control-and-reflect-state.md) runs again.

No SQL/table interaction occurs directly in this operation; it operates purely against in-memory business objects already loaded by the BOF layer.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Control lifecycle calls DataBind]) --> Check{RootBindingObject is Nothing?}
	Check -->|Yes| EndNoOp([No-op, return])
	Check -->|No| Bind[BindToControl reads BoundObject property into Value]
	Bind --> AutoVal{AutoValidateOnDataBind?}
	AutoVal -->|Yes| Val[Validate control]
	AutoVal -->|No| Render[Render editor with Value]
	Val --> Render
	Render --> Postback([User edits and posts back])
	Postback --> WriteBack[BindToObject writes Value back onto BoundObject]
	WriteBack --> AutoVal2{AutoValidate?}
	AutoVal2 -->|Yes| Val2[Validate control]
	AutoVal2 -->|No| EndOk([Done])
```

## Failure and edge-case behavior
- `RootBindingObject Is Nothing`: `DataBind()` returns immediately without binding the control.
- `BindingUtility.GetObjectValue`/`SetObjectValue`/`BindValue` swallow `NotSupportedException` internally (e.g., for reflection failures on unsupported property types) — the bind silently fails rather than throwing.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

## Sources
- `SAIF.Presentation.Web.Controls.AJAX.Infragistics103\AutoBindControlAncestor.vb`
- `SAIF.Presentation.Web.Controls.AJAX.Infragistics103\BindingUtility.vb`
- `SAIF.Presentation.Web.Controls.AJAX.Infragistics103\AutoBindTextbox.vb`
- `SAIF.Presentation.Web.Controls.AJAX.Infragistics103\AutoBindWebDateTimeEdit.vb`
- `SAIF.Presentation.Web.Controls.AJAX.Infragistics103\AutoBindWebMaskEdit.vb`
