Skip to main content

TcxDataControllerConditionalFormatting.Add(string,TdxSpreadSheetCustomConditionalFormattingRuleClass,Untyped) Method

Creates a new rule and adds it to the conditional formatting controller.

Declaration

procedure Add(const AFieldName: string; ARuleClass: TdxSpreadSheetCustomConditionalFormattingRuleClass; out ARule); overload;

Parameters

Name Type
AFieldName string
ARuleClass TdxSpreadSheetCustomConditionalFormattingRuleClass
ARule

Remarks

Call this procedure and pass the target conditional formatting rule’s class-reference as the ARuleClass parameter to create the rule and apply it to a specific field in the source data controller. The Add procedure returns a newly created rule as the ARule out parameter. Cast ARule to the class corresponding to the ARuleClass reference to access the rule’s type-specific members.

The second and third overloaded Add procedure variants set the created rule’s target field by its index and display name, respectively.

Alternatively, you can call the target rule class’ Create constructor and pass the conditional formatting controller as a parameter.

To delete a rule, you can either pass it as the Remove procedure’s parameter or directly call the rule’s Free procedure.

Note

The Rules property provides indexed access to all individual rules in the controller. As in the case of an ARule out parameter value, you need to cast a target property value to the corresponding rule class to access the rule’s type-specific members.

See Also