Highlight grid rows/cells with broken business rules¶
This operation renders the outcome of BOF business-object validation onto a data-bound WebDataGrid, visually flagging cells whose bound property has a broken business rule.
| Field | Value |
|---|---|
| Operation ID | OP-AVPB-003 |
| Trigger | Called by consuming page code after a save/validate attempt on a data-bound WebDataGrid |
| Inputs | The grid (WebDataGrid), inSetFocusOnFirstError flag |
| Outputs | Boolean (whether any error was found), CSS/focus side effects |
| Primary components | AppViewPageBase.SetErrorColorInGrid |
| Entry point | SAIF.Presentation.Web.Core.Infragistics103\AppViewPageBase.aspx.vb |
Steps¶
- Iterates every
GridRecordin the grid; castsDataItemtoclsBusinessBase(BOF business object). - If the cast succeeds and
myObject.IsValidisFalse, iteratesmyObject.Rules.BrokenRulesand, for each broken rule, appends the CSS class"wgcerror"to the grid cell whose column key matches the broken rule'sPropertyName— enforces BR-AVPB-002. - On failure: the cell lookup is wrapped in
Try/Catchand silently skipped (e.g., column not present in the grid). - On the first error found, if
inSetFocusOnFirstErrorisTrue, setsBehaviors.Activation.ActiveCellto that cell. - Returns
Trueif no error was ever found (i.e.,firstErrorremainedTrue); otherwiseFalse.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([SetErrorColorInGrid called]) --> S1[Iterate GridRecords]
S1 --> S2{DataItem is clsBusinessBase and IsValid = False?}
S2 -->|No| Next[Continue to next record]
S2 -->|Yes| S3[Iterate Rules.BrokenRules]
S3 --> S4[Append wgcerror CSS to matching cell]
S4 --> D1{First error and inSetFocusOnFirstError?}
D1 -->|Yes| S5[Set ActiveCell to error cell]
D1 -->|No| Next
Next --> EndReturn([Return True if no errors found, else False])
Failure and edge-case behavior¶
- A column lookup failure for a given rule is silently skipped via
Try/Catch. - This operation consumes BOF validation results (
IsValid,Rules.BrokenRules) produced elsewhere (in the business-object layer, out of scope here) but does not itself define or evaluate business rules — it only renders their outcome.
Related documentation¶
Sources¶
- SAIF.Presentation.Web.Core.Infragistics103\AppViewPageBase.aspx.vb