Skip to main content
Table of Contents

TTMSFNCDataGridConditionalFormatting.AddCellValueRule Method

Adds a grtCellValue rule that compares a column's value against a reference value.

API unit family: TMSFNCDataGridConditionalFormatting Declaring type: TTMSFNCDataGridConditionalFormatting

Overloads

Overload 1

Adds a grtCellValue rule that compares a column's value against a reference value.

FMX.TMSFNCDataGridConditionalFormatting.hppPascalC++
function AddCellValueRule(AColumn: Integer; AComparison: TTMSFNCDataGridFormatComparison; const AValue: string): TTMSFNCDataGridFormatRuleItem; overload;
TTMSFNCDataGridFormatRuleItem* __fastcall AddCellValueRule(int AColumn, TTMSFNCDataGridFormatComparison AComparison, const System::UnicodeString AValue)/* overload */;

Remarks

The rule has no appearance yet; chain TTMSFNCDataGridFormatRuleItem.Highlight or use AddValueHighlight. For dates and floating-point values prefer the TTMSFNCValue overload.

Parameters

Name Description
AColumn Zero-based column index the rule applies to.
AComparison The comparison operator to use.
AValue The reference value compared against the cell value, as text; it is parsed into a typed value when the rule is evaluated.

Returns

The newly added rule, owned by the collection.

Overload 2

Adds a grtCellValue rule that compares a column's value against a typed reference value.

FMX.TMSFNCDataGridConditionalFormatting.hppPascalC++
function AddCellValueRule(AColumn: Integer; AComparison: TTMSFNCDataGridFormatComparison; const AValue: TTMSFNCValue): TTMSFNCDataGridFormatRuleItem; overload;
TTMSFNCDataGridFormatRuleItem* __fastcall AddCellValueRule(int AColumn, TTMSFNCDataGridFormatComparison AComparison, const TTMSFNCValue &AValue)/* overload */;

Remarks

The value is stored through TTMSFNCDataGridFormatRuleItem.WithValue, so dates and numbers compare with their own type regardless of locale formatting.

Parameters

Name Description
AColumn Zero-based column index the rule applies to.
AComparison The comparison operator to use.
AValue The reference value compared against the cell value.

Returns

The newly added rule, owned by the collection.

Overload 3

Adds a grtCellValue rule that compares a column's value against two typed bounds, for a gfcBetween or gfcNotBetween comparison. Both bounds are inclusive and their order does not matter.

FMX.TMSFNCDataGridConditionalFormatting.hppPascalC++
function AddCellValueRule(AColumn: Integer; AComparison: TTMSFNCDataGridFormatComparison; const AFrom, ATo: TTMSFNCValue): TTMSFNCDataGridFormatRuleItem; overload;
TTMSFNCDataGridFormatRuleItem* __fastcall AddCellValueRule(int AColumn, TTMSFNCDataGridFormatComparison AComparison, const TTMSFNCValue &AFrom, const TTMSFNCValue &ATo)/* overload */;

Remarks

The bounds are stored through TTMSFNCDataGridFormatRuleItem.WithRange.

Parameters

Name Description
AColumn Zero-based column index the rule applies to.
AComparison The comparison operator to use, normally gfcBetween or gfcNotBetween.
AFrom The first bound, inclusive.
ATo The second bound, inclusive.

Returns

The newly added rule, owned by the collection.