TTMSFNCDataGridFormatRuleItem Class
One conditional-formatting rule. A single item class carries the settings for every rule type, discriminated by
RuleType, so a single collection editor can manage every kind of rule.
API unit family: TMSFNCDataGridConditionalFormatting
Inherits from: TCollectionItem
Syntax
TTMSFNCDataGridFormatRuleItem = class(TCollectionItem)
Remarks
Add and configure instances through TTMSFNCDataGridConditionalFormatting, either via its Add/AddXxx convenience methods or by editing Formatting's collection at design time.
Properties
| Name | Description |
|---|---|
| Appearance | The cell layout this rule merges into a matching cell for non-overlay, non-colour-scale rule types. |
| ApplyToEntireRow | When True, the rule is evaluated once per row using Column as the trigger, and its result is applied to every cell in the row. Default is False. |
| AverageKind | How a grtAverage rule compares the cell value against the scope's mean. Default is akAbove. |
| CaseSensitive | When True, text comparisons are case-sensitive. Default is False. |
| CellRange | The explicit rectangular cell range this rule covers when Scope is grsCellRange. |
| CellRangeEndColumn | The zero-based end column of the rectangular range used when Scope is grsCellRange. Default is 0. |
| CellRangeEndRow | The zero-based end row of the rectangular range used when Scope is grsCellRange. Default is 0. |
| CellRangeStartColumn | The zero-based start column of the rectangular range used when Scope is grsCellRange. Default is 0. |
| CellRangeStartRow | The zero-based start row of the rectangular range used when Scope is grsCellRange. Default is 0. |
| ColorScale | The gradient settings used when RuleType is grtColorScale. |
| Column | The zero-based column index used when Scope is grsColumn or grsColumnRange, and the trigger column when ApplyToEntireRow is set. |
| ColumnTo | The zero-based end column index used when Scope is grsColumnRange. |
| Comparison | The comparison operator used by grtCellValue and grtText rules. Default is gfcEqual. |
| DataBar | The data-bar settings used when RuleType is grtDataBar. |
| DateFrom | First date matched by a grtDate rule whose DateInterval is diCustomRange, inclusive. |
| DateInterval | The relative date bucket used by a grtDate rule. Default is diToday. |
| DateTo | Last date matched by a grtDate rule whose DateInterval is diCustomRange, inclusive. |
| DuplicateKind | Whether a grtUniqueDuplicate rule matches duplicated or unique values. Default is dkDuplicate. |
| Enabled | When False, the rule is skipped during evaluation. Default is True. |
| Expression | The boolean expression evaluated against each row for a grtExpression rule. |
| Formatting | The conditional-formatting collection that owns this rule. |
| IconSet | The icon-set settings used when RuleType is grtIconSet. |
| Priority | The precedence of this rule relative to the others; a lower value wins. Default is 0. |
| RankCount | The number of values (or, when RankIsPercent is set, the percentage) a grtTopBottom rule matches. Default is 10. |
| RankIsPercent | When True, RankCount is interpreted as a percentage of the scope rather than an absolute count. Default is False. |
| RankKind | Whether a grtTopBottom rule matches the highest or lowest values. Default is rkTop. |
| RuleType | The kind of rule, selecting which fields below are used and how the rule is evaluated. Default is grtCellValue. |
| Scope | The set of cells this rule applies to. Default is grsColumn. |
| StopIfTrue | When True, no lower-priority rule is evaluated for a cell once this rule matches. Default is False. |
| Value1 | The first reference value compared against the cell value or text. |
| Value2 | The second reference value used for a between/not-between comparison. |
Methods
| Name | Description |
|---|---|
| AppearanceAspects | The appearance aspects this rule actually sets, and therefore the aspects it claims when it matches a cell. |
| EffectiveExpression | The expression as evaluated. An expression that names no column with [ ] is applied to this rule's own Column, so a bare condition such as =M* or >1000 works the way a filter condition does. |
| ForCellRange | Scopes this rule to a rectangular cell range. |
| ForColumn | Scopes this rule to a single column. |
| ForColumns | Scopes this rule to an inclusive range of columns. |
| ForEntireRow | Makes this rule highlight the entire row, evaluated against the value in one trigger column. |
| GetDisplayName | Returns a readable description of the rule — its scope, rule type, and disabled state — shown in the collection editor. |
| Highlight | Configures this rule's Appearance with a solid fill and, optionally, a text color and bold font. |
| WithBorder | Configures this rule's Appearance with a solid border stroke of the given color for matching cells. |
| WithDateRange | Turns the rule into a grtDate rule matching the explicit date range .., both inclusive. |
| WithRange | Sets Value1 and Value2 from typed values for a gfcBetween or gfcNotBetween comparison. Both bounds are inclusive and their order does not matter. |
| WithValue | Sets Value1 from a typed value, formatted so the comparison reads it back with the same type. |