---
title: CustomValidator
summary: API reference for CustomValidator.
status: draft
owner: SAIF documentation team
last_reviewed: 2026-08-17
library: SAIF.Presentation.Web.Binding.Infragistics103
reference_type: embedded
---

# CustomValidator

This function delegate is the active method-mode custom validation hook used by `clsCustomValidator`, letting caller code inspect the validator instance itself and decide whether the current validation pass should fail. The binder uses it when validation needs access to both configuration and accumulated state on the validator rather than just the raw bound object.

## Purpose

- Provides the active function-style callback contract for method-mode custom validation registration.
- Allows validator logic to inspect `clsCustomValidator` state, including bound source, configured property, control association, and error collection, before reporting success or failure.


## 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 |
| --- | --- | --- |
| CustomValidator | `Public Delegate Function CustomValidator(ByRef inValidator As clsCustomValidator) As Boolean` | Invoked by `clsCustomValidator.PerformValidation()` when `ValidationType` is `Method`, receiving the validator instance itself; the callback should return `False` to cause the validator to flag an error condition for the current validation pass. |


## Behavioral notes

- `clsObjectBindManager.AddCustomValidator(inControl, target, validationMethod)` stores this delegate in `MethodValidationDelegate` and marks the validator as method-mode.
- When the callback returns `False`, `clsCustomValidator.PerformValidation()` sets `m_Errors = True` before control formatting and message aggregation continue.


## Constraints and usage notes

- Returning `False` reports failure; callers that also need message text must populate the validator's error collection through the validator instance or surrounding validation flow.
- This method-mode path is separate from property-mode validation and does not use the `MethodValidator` delegate type.
## Sources

- `SAIF.Presentation.Web.Binding.Infragistics103\Enums.vb`
- `SAIF.Presentation.Web.Binding.Infragistics103\clsCustomValidator.vb`
- `SAIF.Presentation.Web.Binding.Infragistics103\clsObjectBindManager.vb`
