Skip to content

clsObjectBindManager

clsObjectBindManager is the page-level binding container an application drops onto an ASP.NET WebForms page as a System.Web.UI.Control. It is this library's only public entry point: it owns the registered-binder collection (m_Bindings), the per-object validation registry (m_ValidationObjects), the aggregated error list, and the page-lifecycle hooks that drive registration, initialization, data movement, and validation across every bound control on the page.

Purpose

  • Register bindings via ~60 Add overloads (one family per supported control type) and three AddCustomValidator overloads, dispatching to the matching concrete binder by the control's compile-time type (BR-BIND-001).
  • Drive the page lifecycle: initialize binders and their change-event subscriptions on OnLoad, and optionally auto-bind on OnPreRender (see Register a binding, Initialize binders (page load)).
  • Push and pull data between business objects and controls (DataBind, BindToObject) and run full validation with error aggregation and control re-styling (Validate, RefreshValidation).
  • Re-point an existing grid or drop-down binder at a new collection after a postback (Update), and look up the binder registered for a specific control (Binder).

Context

  • Namespace: SAIF.Presentation.Web.Binding
  • Assembly/package: SAIF.Presentation.Web.Binding.Infragistics111 (ILMerged into SAIF.Presentation.Web.Infragistics111.dll)
  • Base class: System.Web.UI.Control

Public members

Member Signature Purpose
FormattedErrorMessage Public ReadOnly Property FormattedErrorMessage() As String All distinct error messages joined with <BR> (BR-BIND-041).
ErrorLabel Public Property ErrorLabel() As Label Optional label that receives the formatted error text (BR-BIND-042).
SAIFMessage Public Property SAIFMessage() As SAIFMessage Optional SAIF message control that receives the formatted error text (BR-BIND-042).
AutoBind Public Property AutoBind() As Boolean When True, DataBind() runs automatically on PreRender; persisted in ViewState (BR-BIND-006, BR-BIND-018).
FirstControlWithError Public ReadOnly Property FirstControlWithError() As WebControl The first control found with a validation error, so the page can focus it (BR-BIND-035).
FirstRowWithError Public Property FirstRowWithError() As <grid row type> Intended to hold the first grid row found with a validation error; the assignment is commented out in source, so this always returns Nothing.*
FirstColumnWithError Public Property FirstColumnWithError() As <grid column type> Intended to hold the first grid column found with a validation error; the assignment is commented out in source, so this always returns Nothing.*
ValidBackColor Public Property ValidBackColor() As Color Background color applied to a control on successful validation; defaults to White.
ErrorBackColor Public Property ErrorBackColor() As Color Background color applied to a control on validation failure; defaults to Red.
UseEvents Public Property UseEvents() As Boolean Manager-level default for whether new binders hook control change events; defaults to True (BR-BIND-003).
Add Public Function Add(...) As <Binder> (~60 overloads) Registers a control/business-object binding, dispatching to the matching concrete binder by the control's compile-time type (BR-BIND-001, see Register a binding).
AddDualBinder Public Function AddDualBinder(...) As clsObjectBinderBase Registers a binder that displays one object while validating another, for the six CustomBindingControls types (BR-BIND-058, see Dual binding).
AddCustomValidator Public Function AddCustomValidator(...) As clsCustomValidator (3 overloads) Registers an application-supplied validation delegate that participates in the same error pipeline as property-level bindings.
DataBind Public Overrides Sub DataBind() Pushes object values into all ObjectToControl/TwoWay binders (BR-BIND-010, see Push object values into controls).
BindToObject Public Sub BindToObject(Optional inAllControls As Boolean = False) Pulls control values back onto business objects, honoring UseEvents unless inAllControls is True (BR-BIND-019, see Pull control values back into objects).
Validate Public Function Validate() As Boolean Runs the full validation pass, including bind-source IsValid evaluation, and returns overall validity (BR-BIND-029, see Validate bound objects and report errors).
RefreshValidation Public Function RefreshValidation() As Boolean Re-renders existing error state without re-running bind-source IsValid evaluation (BR-BIND-043).
Update Public Overridable Sub Update(control, dataSource) (3 overloads: UltraWebGrid, WebDataGrid, DropDownList) Re-points a grid or drop-down binder at a new data source and rebinds it (BR-BIND-055, BR-BIND-057, see Re-point a binder at a new data source).
Binder Public ReadOnly Property Binder(control As Control) As clsObjectBinderBase Looks up a registered binder by the control's UniqueID (BR-BIND-060, see Look up a binder by control).
ObjectToControl Public Sub ObjectToControl(control As Control) Binder(control).ObjectToControl() directly; an unmatched control raises a NullReferenceException.*

Behavioral notes

  • IsSAIFFrameWorkObject is duplicated as a private method on this class in addition to the Friend property on clsObjectBinderBase (BR-BIND-061).*
  • Validate() and RefreshValidation() share roughly 50 lines of duplicated logic; the only difference is that RefreshValidation omits the bind-source IsValid read.*

Constraints and usage notes

  • The only public entry point applications interact with; individual binders are reached only through Add/AddDualBinder/AddCustomValidator or the Binder(control) lookup.

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. They describe inherited behavior from the indicated origin library and should be verified if the dependency version changes.

Sources

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