---
title: Validate a grid collection
summary: Validate every row (and hierarchical child row) of a bound grid collection and highlight invalid cells.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-08-17
library: SAIF.Presentation.Web.Binding.Infragistics111
reference_type: package
operation_id: OP-BIND-006
trigger: "`Validate()` reaching a grid binder"
---

# Validate a grid collection

Validate every row (and hierarchical child row) of a bound grid collection and highlight invalid cells.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-BIND-006 |
| **Trigger** | `Validate()` reaching a grid binder |
| **Inputs** | The bound collection, the grid's bands and columns |
| **Outputs** | Cell-level red highlighting, collected error messages, activated first invalid cell |
| **Primary components** | `clsUltraGridBinder.GetErrors`, `ResetControlFormatting`, `ResetRows`, `ValidateObject`, `GetGridRow` (and the equivalents in `clsWebDataGridBinder` / `clsWebHierarchicalDataGridBinder`) |
| **Entry point** | `SAIF.Presentation.Web.Binding.Infragistics111/InfragisticsClassicControls/clsUltraGridBinder.vb` |

## Steps

1. Reset the binder's error flag and re-apply each cell's normal background — the band's `RowAlternateStyle.BackColor` for alternate rows and `RowStyle.BackColor` otherwise — recursing into child rows. ([BR-BIND-044](../business-rules.md#br-bind-044-grid-validation-resets-formatting-first))
2. Cast the bound **collection** to `IDataErrorInfo` and read its `Error` property; when non-empty, split it on CRLF, strip `<BR>`, and add each fragment as a collection-level error, then return. ([BR-BIND-045](../business-rules.md#br-bind-045-collection-level-error-short-circuits-row-validation))
   - On failure: a cast failure is caught and ignored so that non-`IDataErrorInfo` sources fall through to per-object validation ([BR-BIND-046](../business-rules.md#br-bind-046-non-idataerrorinfo-objects-skipped-silently)).
3. For each object in the collection and each band of the grid, build the band's column-key list. For band index 0 validate the object itself; for deeper bands resolve the child collection named by `Band.BaseTableName` from the parent object and validate each child. ([BR-BIND-047](../business-rules.md#br-bind-047-child-bands-resolved-via-basetablename))
4. `ValidateObject` casts the object to `IDataErrorInfo` and reads `Item(columnKey)` for every column key — that is, **grid column keys are treated as business object property names**. ([BR-BIND-048](../business-rules.md#br-bind-048-grid-column-keys-map-to-property-names))
   - On failure: any exception in `ValidateObject` is swallowed so that objects not implementing `IDataErrorInfo` are skipped rather than failing the page ([BR-BIND-046](../business-rules.md#br-bind-046-non-idataerrorinfo-objects-skipped-silently)).
5. Non-empty error text marks the column invalid and its split fragments are added to `ControlErrors`. ([BR-BIND-032](../business-rules.md#br-bind-032-error-text-split-and-br-stripped))
6. Resolve the grid row for the object using the configured key property (or, for hierarchical grids, the band-specific key from `HierarchialGridArgs.GetKeyProperty`). ([BR-BIND-049](../business-rules.md#br-bind-049-grid-row-located-by-key-property))
7. Set every invalid cell's `Style.BackColor` to `Color.Red` and `Activate()` the **first** invalid cell only. ([BR-BIND-050](../business-rules.md#br-bind-050-invalid-cells-highlighted-first-cell-activated))

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Validate reaches grid binder]) --> S1[Reset cell formatting]
	S1 --> D1{Collection implements IDataErrorInfo.Error?}
	D1 -->|Yes, non-empty| S2[Add collection-level error and return]
	D1 -->|No / empty| S3[For each object and band: validate columns]
	S3 --> D2{Object implements IDataErrorInfo?}
	D2 -->|No| Skip[Skip silently]
	D2 -->|Yes| S4[Read Item columnKey per column]
	S4 --> S5[Mark invalid cells red]
	S5 --> S6[Activate first invalid cell]
	S6 --> End([Grid validation complete])
	Skip --> End
```

## Failure and edge-case behavior

- Objects that do not implement `IDataErrorInfo` are skipped silently rather than raising an error, so mixed collections do not break the page ([BR-BIND-046](../business-rules.md#br-bind-046-non-idataerrorinfo-objects-skipped-silently)).

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

> **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/InfragisticsClassicControls/clsUltraGridBinder.vb
