Skip to content

clsObjectBindManager

This page-level coordinator owns the binder registry for a WebForms screen, selects the correct binder for each supported ASP.NET or Infragistics control family, and drives the object-to-control, control-to-object, and validation passes across that registry. It also aggregates unique error text, tracks the first failing control or grid location, and writes consolidated messages into optional Label or SAIFMessage collaborators.

Purpose

  • Centralize binder registration behind one façade instead of requiring pages to instantiate binder classes directly.
  • Execute bind and validation workflows across standard binders, custom validators, and dual-binding scenarios.
  • Preserve validation display state and message quality through BR-BIND-004, BR-BIND-005, and BR-BIND-006.

Context

  • Namespace: SAIF.Presentation.Web.Binding
  • Assembly/package: SAIF.Presentation.Web.Binding.Infragistics103 (embedded/bundled as source, not independently packaged)

Public members

Member Signature Purpose
FormattedErrorMessage Public ReadOnly Property FormattedErrorMessage() As String Returns the aggregated error list as one <BR>-delimited block for UI display.
ErrorLabel Public Property ErrorLabel() As Label Supplies the optional label that receives consolidated validation text.
SAIFMessage Public Property SAIFMessage() As SAIFMessage Supplies the optional SAIF message control that mirrors consolidated validation text.
AutoBind Public Property AutoBind() As Boolean Enables automatic DataBind() during OnPreRender.
FirstControlWithError Public ReadOnly Property FirstControlWithError() As WebControl Exposes the first failing control so callers can focus or scroll to it.
FirstRowWithError Public Property FirstRowWithError As UltraGridRow Carries the first failing row reported by grid binders.
FirstColumnWithError Public Property FirstColumnWithError As String Carries the first failing column key reported by grid binders.
ValidBackColor Public Property ValidBackColor() As Color Stores the normal-state color passed into new binders.
ErrorBackColor Public Property ErrorBackColor() As Color Stores the error-state color passed into new binders.
UseEvents Public Property UseEvents() As Boolean Sets the default event-driven update behavior for overloads that omit inUseEvents.
Add(CheckBox) family Public Sub Add(ByVal inCheckBox As CheckBox, ByVal inObject As Object, ByVal inKeyProperty As String, ByVal inUseEvents As Boolean, Optional ByVal inBindType As BindTypes = BindTypes.TwoWay) — 8 overloads Registers Boolean or string-backed checkbox bindings, including CheckBoxBindingArgs variants.
Add(CheckBoxList) family Public Sub Add(ByVal inCheckBoxList As CheckBoxList, ByRef inCollection As IEnumerable, ByVal inKeyProperty As String, ByVal inTextProperty As String, ByVal inBindProperty As String, ByVal inUseEvents As Boolean, Optional ByVal inBindType As BindTypes = BindTypes.TwoWay) — 2 overloads Registers list bindings backed by a collection plus key, text, and selected-value metadata.
Add(DataList) family Public Sub Add(ByVal inDataList As DataList, ByRef inCollection As IEnumerable, ByVal inKeyProperty As String, ByVal inUseEvents As Boolean, Optional ByVal inBindType As BindTypes = BindTypes.TwoWay, Optional ByVal inBoundControlPrefix As String = "bound_") — 1 overload Registers repeating DataList bindings backed by a collection and bound-control prefix.
Add(DropDownList) family Public Sub Add(ByVal inDropDownList As DropDownList, ByVal inObject As Object, ByVal inKeyProperty As String, ByVal inUseEvents As Boolean, Optional ByVal inTargetDataType As ObjectDataType = ObjectDataType.String, Optional ByVal inbindtype As BindTypes = BindTypes.TwoWay) — 2 overloads Registers dropdown bindings and optional target-type conversion for selected values.
Add(HyperLink) family Public Sub Add(ByVal inHyperLink As HyperLink, ByVal inObject As Object, ByVal inKeyProperty As String) — 2 overloads Registers one-way hyperlink text or formatted text bindings.
Add(Label) family Public Sub Add(ByVal inLabel As Label, ByVal inObject As Object, ByVal inKeyProperty As String) — 2 overloads Registers one-way label bindings, optionally with a format string.
Add(RadioButtonList) family Public Sub Add(ByVal inRadioButton As RadioButtonList, ByVal inObject As Object, ByVal inKeyProperty As String, ByVal inUseEvents As Boolean, Optional ByVal inBindType As BindTypes = BindTypes.TwoWay) — 2 overloads Registers radio-button-list bindings with optional explicit event behavior.
Add(TextBox) family Public Sub Add(ByVal inTextBox As WebControls.TextBox, ByVal inObject As Object, ByVal inKeyProperty As String, Optional ByVal inBindType As BindTypes = BindTypes.TwoWay) — 2 overloads Registers standard text-box bindings for text property synchronization.
Add(WebMaskEditor / SAIF variant) family Public Sub Add(ByVal inSAIFMaskEditor As WebMaskEditor, ByVal inObject As Object, ByVal inKeyProperty As String, ByVal inControlBindProperty As ControlBindProperty, ByVal inUseEvents As Boolean, Optional ByVal inBindType As BindTypes = BindTypes.TwoWay) — 4 overloads Registers modern SAIF mask-editor bindings using ControlBindProperty or SAIFMaskEditBindingArgs.
Add(WebDataGrid) family Public Sub Add(ByVal inGrid As WebDataGrid, ByRef inCollection As IEnumerable, ByVal inKeyProperty As String, ByVal inUseEvents As Boolean, Optional ByVal inBindType As BindTypes = BindTypes.TwoWay) — 4 overloads Registers modern data-grid bindings from direct collection arguments or WebDataGridBindingArgs.
Add(WebMaskEditor) family Public Sub Add(ByVal inWebMaskEditor As WebMaskEditor, ByVal inObject As Object, ByVal inKeyProperty As String, ByVal inUseEvents As Boolean, Optional ByVal inTargetDataType As ObjectDataType = ObjectDataType.String, Optional ByVal inBindType As BindTypes = BindTypes.TwoWay) — 8 overloads Registers modern non-SAIF mask-editor bindings, including target-type and padding variants.
Add(WebDatePicker) family Public Sub Add(ByVal inWebDatePicker As WebDatePicker, ByVal inObject As Object, ByVal inKeyProperty As String, ByVal inUseEvents As Boolean, Optional ByVal inBindType As BindTypes = BindTypes.TwoWay) — 2 overloads Registers modern date-picker bindings.
Add(WebDateTimeEditor) family Public Sub Add(ByVal inWebDateTimeEditor As WebDateTimeEditor, ByVal inObject As Object, ByVal inKeyProperty As String, Optional ByVal inTargetIsString As Boolean = False, Optional ByVal inBindType As BindTypes = BindTypes.TwoWay) — 2 overloads Registers modern date-time-editor bindings with optional string-target mode.
Add(WebNumericEditor) family Public Sub Add(ByVal inWebNumericEditor As WebNumericEditor, ByVal inObject As Object, ByVal inKeyProperty As String, ByVal inUseEvents As Boolean, Optional ByVal inBindType As BindTypes = BindTypes.TwoWay) — 4 overloads Registers modern numeric-editor bindings with optional numeric control-property selection.
Add(WebTextEditor) family Public Sub Add(ByVal inWebTextEditor As WebTextEditor, ByVal inObject As Object, ByVal inKeyProperty As String, ByVal inUseEvents As Boolean, Optional ByVal inBindType As BindTypes = BindTypes.TwoWay) — 2 overloads Registers modern text-editor bindings.
Add(WebMaskEdit / SAIF variant) family Public Sub Add(ByVal inSAIFMaskEdit As WebMaskEdit, ByVal inObject As Object, ByVal inKeyProperty As String, ByVal inControlBindProperty As ControlBindProperty, ByVal inUseEvents As Boolean, Optional ByVal inBindType As BindTypes = BindTypes.TwoWay) — 6 overloads Registers classic SAIF mask-edit bindings using direct control-property values or SAIFMaskEditBindingArgs.
Add(UltraWebGrid) family Public Sub Add(ByVal inUltraGrid As UltraWebGrid, ByRef inCollection As IEnumerable, ByVal inKeyProperty As String, ByVal inUseEvents As Boolean, Optional ByVal inBindType As BindTypes = BindTypes.TwoWay) — 6 overloads Registers classic grid bindings using a simple key, hierarchical keys, or UltraGridBindingArgs.
Add(WebCombo) family Public Sub Add(ByVal inWebCombo As Infragistics.WebUI.WebCombo.WebCombo, ByVal inObject As Object, ByVal inKeyProperty As String, ByVal inUseEvents As Boolean, Optional ByVal inbindtype As BindTypes = BindTypes.TwoWay) — 2 overloads Registers classic combo bindings for selected-value synchronization.
Add(WebMaskEdit) family Public Sub Add(ByVal inWebMaskEdit As WebMaskEdit, ByVal inObject As Object, ByVal inKeyProperty As String, ByVal inUseEvents As Boolean, Optional ByVal inTargetDataType As ObjectDataType = ObjectDataType.String, Optional ByVal inBindType As BindTypes = BindTypes.TwoWay) — 8 overloads Registers classic non-SAIF mask-edit bindings, including padding variants.
Add(WebDateChooser) family Public Sub Add(ByVal inWebDateChooser As WebDateChooser, ByVal inObject As Object, ByVal inKeyProperty As String, ByVal inUseEvents As Boolean, Optional ByVal inBindType As BindTypes = BindTypes.TwoWay) — 2 overloads Registers classic date chooser bindings.
Add(WebDateTimeEdit) family Public Sub Add(ByVal inWebDateTimeEdit As WebDateTimeEdit, ByVal inObject As Object, ByVal inKeyProperty As String, Optional ByVal inTargetIsString As Boolean = False, Optional ByVal inBindType As BindTypes = BindTypes.TwoWay) — 2 overloads Registers classic date-time-edit bindings with optional string-target mode.
Add(WebHtmlEditor) family Public Sub Add(ByVal inWebEditor As Infragistics.WebUI.WebHtmlEditor.WebHtmlEditor, ByVal inObject As Object, ByVal inKeyProperty As String, ByVal inUseEvents As Boolean, Optional ByVal inbindtype As BindTypes = BindTypes.TwoWay) — 2 overloads Registers classic HTML editor bindings for rich-text values.
Add(WebNumericEdit) family Public Sub Add(ByVal inWebNumericEdit As WebNumericEdit, ByVal inObject As Object, ByVal inKeyProperty As String, ByVal inUseEvents As Boolean, Optional ByVal inBindType As BindTypes = BindTypes.TwoWay) — 4 overloads Registers classic numeric-editor bindings with optional numeric control-property selection.
Add(WebTextEdit) family Public Sub Add(ByVal inWebTextEdit As WebTextEdit, ByVal inObject As Object, ByVal inKeyProperty As String, ByVal inUseEvents As Boolean, Optional ByVal inBindType As BindTypes = BindTypes.TwoWay) — 2 overloads Registers classic text-edit bindings.
AddDualBinder Public Sub AddDualBinder(ByVal inControl As WebControls.WebControl, ByVal inControlType As CustomBindingControls, ByVal inBindObject As Object, ByVal inBindProperty As String, ByVal inValidationObject As Object, ByVal inValidationProperty As String, Optional ByVal inArgs As Object = Nothing, Optional ByVal inBindType As BindTypes = BindTypes.TwoWay) Registers a binder whose displayed value comes from one object/property pair while validation comes from another.
AddCustomValidator Public Sub AddCustomValidator(ByVal target As Object) Registers object-level validation that reads the target's IsValid property.
AddCustomValidator Public Sub AddCustomValidator(ByVal target As Object, ByVal KeyProperty As String, ByVal inPropertyValidator As PropertyValidator) Registers property-level validation backed by a caller-supplied delegate.
AddCustomValidator Public Sub AddCustomValidator(ByVal inControl As WebControls.WebControl, ByVal target As Object, ByRef inValidationMethod As CustomValidator) Registers method-level validation backed by a caller-supplied delegate.
DataBind Public Overrides Sub DataBind() Pushes object values into binders configured for ObjectToControl or TwoWay.
BindToObject Public Sub BindToObject(Optional ByVal inAllControls As Boolean = False) Pulls control values back into bound objects for eligible binders.
Update Public Overridable Sub Update(ByVal inUltraGrid As UltraWebGrid, ByVal inUltraGridSource As IEnumerable) Re-points an existing classic grid binder at a new collection and refreshes the grid.
Update Public Overridable Sub Update(ByVal inUltraGrid As WebDataGrid, ByVal inUltraGridSource As IEnumerable) Re-points an existing modern data-grid binder at a new collection and refreshes the grid.
ObjectToControl Public Overridable Sub ObjectToControl(ByVal inControl As Control) Refreshes a single registered control by invoking its binder's outbound bind pass.
Binder Public ReadOnly Property Binder(ByVal inBoundControl As Control) As clsObjectBinderBase Returns the binder registered for a specific control UniqueID.
Update Public Overridable Sub Update(ByVal inDDL As DropDownList, ByVal inDataSource As Object) Re-points an existing dropdown binder at a new data source and refreshes the list.
Validate Public Function Validate() As Boolean Binds pending control values, revalidates tracked objects, aggregates unique errors, formats controls, and returns overall validity.
RefreshValidation Public Function RefreshValidation() As Boolean Re-reads current binder errors and reapplies formatting without first re-running tracked-object IsValid checks.

Behavioral notes

  • Validate() and RefreshValidation() preserve the first control already marked invalid, preventing a later valid-format pass from clearing that indicator as required by BR-BIND-004.
  • Error aggregation suppresses duplicate strings before writing to FormattedErrorMessage, ErrorLabel, or SAIFMessage, implementing BR-BIND-005.
  • Binder registration stores one validation object per computed validation key, so revalidation follows the SAIF-framework-object keying rule in BR-BIND-006.
  • DataBind() only runs outbound binders, while BindToObject() only runs inbound or two-way binders and skips event-driven ones unless inAllControls is True.

Constraints and usage notes

  • This type orchestrates clsObjectBinderBase instances but does not inherit from that base class.
  • AutoBind affects OnPreRender; when it is False, callers must invoke DataBind() themselves.
  • RefreshValidation() is for redisplaying current validation state, not forcing a fresh ValidateBindSources() pass.

Sources

  • SAIF.Presentation.Web.Binding.Infragistics103\clsObjectBindManager.vb