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¶
- Reset the binder's error flag and re-apply each cell's normal background — the band's
RowAlternateStyle.BackColorfor alternate rows andRowStyle.BackColorotherwise — recursing into child rows. (BR-BIND-044) - Cast the bound collection to
IDataErrorInfoand read itsErrorproperty; when non-empty, split it on CRLF, strip<BR>, and add each fragment as a collection-level error, then return. (BR-BIND-045) - On failure: a cast failure is caught and ignored so that non-
IDataErrorInfosources fall through to per-object validation (BR-BIND-046). - 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.BaseTableNamefrom the parent object and validate each child. (BR-BIND-047) ValidateObjectcasts the object toIDataErrorInfoand readsItem(columnKey)for every column key — that is, grid column keys are treated as business object property names. (BR-BIND-048)- On failure: any exception in
ValidateObjectis swallowed so that objects not implementingIDataErrorInfoare skipped rather than failing the page (BR-BIND-046). - Non-empty error text marks the column invalid and its split fragments are added to
ControlErrors. (BR-BIND-032) - 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) - Set every invalid cell's
Style.BackColortoColor.RedandActivate()the first invalid cell only. (BR-BIND-050)
Process flow¶
The following diagram visualizes this operation's control flow.
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
IDataErrorInfoare skipped silently rather than raising an error, so mixed collections do not break the page (BR-BIND-046).
Related documentation¶
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